The size of the resulting matrix TargetMat is automatically adjusted to the size of Mat1. The function returns the following error codes:
0 ... everything is OK -1 ... the sizes of Mat1 and Mat2 do not match