I have two matrices in Mathcad 15 with the same number of rows each and the same number of columns each. The number of rows and columns are not fixed.
I want to obtain a combined matrix, as indicated below, where C1, C2, C3 are columns:
MatrixA_C1 MatrixB_C1 MatrixA_C2 MatrixB_C2 MatrixA_C3 MatrixB_C3 ...
See attached example in Mathcad 15.
Thank you,
Otilia
Solved! Go to Solution.
Here are two functions to achieve the desired result.
The two matrices must have the same dimensions (same number of columns and rows) - there is no error check built in.
You can address each column of each matrix, A<0> means the zeroth(first) column of matrix A.
After that you can use the augment command:
result := augment(A<0>, B<0>, A<1>, B<1>, )
For any single case you could write it out, for general use you could program it.
Here are two functions to achieve the desired result.
The two matrices must have the same dimensions (same number of columns and rows) - there is no error check built in.
Here's another option:
Alan
Thank you, the two solutions that consider x number of rows and y number of columns work perfectly with my case, but I can use the function for multiple variables which i have in the same calculation file (density, enthalpy, entropy).
Otilia