How can I reshape a 2d array to a 3d array with the last column being used as pages? All data found in array2d should be in pages
example:
array2d=[7,.5,12; ...
1,1,1; ...
1,1,1; ...
4,2,4; ...
2,2,2; ...
2,2,2; ...
3,3,3; ...
3,3,3; ...
3,3,3];
The first page in the array would be 7,.5,12; 1,1,1; 1,1,1;
The second page in the array would be 4,2,4; 2,2,2; 2,2,2;
The third page in the array would be 3,3,3; 3,3,3; 3,3,3;
This is a 9x3 array how can I get it to be a 9x3x? (not sure what this number should be so I placed a question mark as a place holder) multidimensional array?
What I'm trying to get is to have All the ones would be on one dimension/page all the two's would be another dimension/page etc... –
I tried reshape(array2d,[9,3,1]) and it's still a 9x3
repmator give a simple minimal examplea(:,:,1)=[1 2 ; 1 2]what willa(:,:,2)look like?out(:,:,1) = ones(3,3), out(:,:,2) = 2*ones(3,3)...etc., given the above example.