MATLAB: Change a 4-D matrix

reshape

I have A(p,s,d,f). How can I change it to A(p,s,f,d)?
Thanks,

Best Answer

A = permute(A,[1 2 4 3]);