Hi,
I have a question, if I have a matrix, lets say a 3×12 matrix:
a= 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3
is there a method other than for looping to section this matrix and place the elements in a 3d matrix such, that it has a structure of (without changing the position of the 1, 2, 3 elements):
b(:,:,1) = 1 1 1 1 1 1 1 1 1 1 1 1b(:,:,2) = 2 2 2 2 2 2 2 2 2 2 2 2b(:,:,3) = 3 3 3 3 3 3 3 3 3 3 3 3
Is there a method doing this without using for looping?
Best Answer