
How do I combine 3D matrices with concatenation along the row index?

jjweimer
Suppose that I have two matrices, A and B. Does something more elegant exist (e.g. in MatrixOP) to combine them as below?
variable nArows = DimSize(A,0) variable nBrows = DimSize(B,0) duplicate A C redimension/N=(nArows+nBrows,*,*) C C[nArows,][][] = B[p-nArows][][]
Concatenate/NP=0/O {A,B},C
Should do the job, no?
September 28, 2024 at 08:28 pm - Permalink
The operation Concatenate/NP=0 {A, B} C creates C building along layers not into rows.
A[6,2,4] B[6,2,4] --> C[6,2,8] desired is C[12,2,4]
September 29, 2024 at 08:05 pm - Permalink
Then we must have different Igor versions. My command is doing what you requested in your initial post, i.e., stitching the rows together. NP=0 means exactly that => stitch rows without promotion. See also the attachment.
September 29, 2024 at 08:14 pm - Permalink
Ugh! I missed the /NP=0, not just /NP (with no value). Thanks.
September 30, 2024 at 06:55 pm - Permalink