MATLAB: Convert 6381×3 double to 1x3x6381 double

convert

I have a column of data in the form of 6381×3 but I want it in the form of 1x3x6381. Is this possible? The image shows the output I want.

Best Answer

You can use permute:
permute(arr,[3,2,1])
Depending on the order of the elements, you might also need a few reshape operations.
Related Question