MATLAB: How to convert matrix format

matrix manipulation

Hey ! I know this will be a very basic question but as I am new to matlab, I want to ask that how can I convert my single matrix of 4 x 163840 to the format of 10 equal frames of 256 x4 x64. This is the format of data matrix.
The first picture is the m,atrix I need to convert and the second picture is the example format I need to achieve. Can anybody help?
Thanks in advance !

Best Answer

You do not give enough information about the order you want the elements to be in, but this should get you started:
>> B = reshape(A,[4,256,64,10]);
>> B = permute(B,[2,1,3,4]);