In MATLAB, is there a way to rotate array elements into another dimension, for example:
y=[-1,0,1] --> y=[-1; 0; 1] (like transpose) y=[-1,0,1] --> y(:,:,1)=-1, y(:,:,2)=0, y(:,:,3)=1 y=[-1,0,1] --> y(:,:,1,1)=-1, y(:,:,1,2)=0, y(:,:,1,3)=1
I would like to avoid cycles.
Frank source share