P
Posts:
26
Registered:
8/4/08


Re: vector/matrix manipulation question
Posted:
Feb 14, 2013 6:14 PM


Thank you Bruno!
Permute is exactly what I was seeking for.
For 1. your solutions do work for 2D array. I'm wondering if there is solution for 3D array?
For example, let say a = [1 2 3; 4 5 6]; b = 2*a; c(1,:,:) = a c(2,:,:) = b
c(:,:,1) = 1 4 2 8 c(:,:,2) = 2 5 4 10 c(:,:,3) = 3 6 6 12
The desired output e is
e(:,:,1) = 1 4 2 8 e(:,:,2) = 1 4 2 8 e(:,:,3) = 2 5 4 10 e(:,:,4) = 2 5 4 10 e(:,:,5) = 3 6 6 12 e(:,:,6) = 3 6 6 12

