MATLAB: How to turn a column vector into a 3D matrix

2-d3-dmatrixvector

I have a 324×1 matrix, and I would like to put it into a 3-D 9×12 matrix of i,j,k with the first numbers in the vector going to the first layer and after that fills up start filling the second layer.

Best Answer

A = rand(324,1) ;
M = 9*12 ;
N = 324/M ;
K = reshape(A,[9 12 N]) ;
Related Question