Say I have a matrix called Y that is (21x21) and I have matrix A that is (3x3). I would like to have matrix A placed in Y starting at Y1,1 so that
I am new to using mathcad, thanks for the help.
Prime 4 and MathCad implementation
Arrays start index is 0 by default, to establish Y as a 21x21 matrix, set the last element to zero.
Enter an arbitrary A matrix.
Set up two range variables to operate over the matrices.
Using the range variables enter A into Y at correct location.
I assume you want 1,1 to be the origin of the array, in which case you should be aware that in Mathcad the default origin is 0,0. You can chnage it to 1,1 though.
Given that, you can do what you ask using a couple of range variables:
if that does not solve your problem, then we need more infomation about what you wish to do.
Personally I would prefer using a small utility routine to do the job. Especially if you need to do it more than once and for different insert positions.
Here is a quick hack. Its ORIGIN aware, so you can use it without changes in a sheet which hast ORIGIN set to 1 instead od the default 0. But the routine lacks error checking - e.g. for wrong indices. If you provide an insertion index which is lower than ORIGIN, you will get an errror from Mathcad. If you provide an insertion index which is to big, then the resulting matrix will be extended and the new positions filled with zeros. In the example, Insert(A,Y,19,20) will result in a 22 x 23 matrix instead of the 21 x 21. You would have to state what should happen in this case. Either an error message or inserting A only partial so that the result is still 21 x 21.