title: Array rotation in MATLAB
body: <p>In MATLAB, is there a way to rotate the elements of a array to another dimension, like:</p>
  
  <pre><code>y=[-1,0,1] --&gt;  y=[-1; 0; 1] (like transpose)
  
  y=[-1,0,1] --&gt;  y(:,:,1)=-1, y(:,:,2)=0, y(:,:,3)=1 
  
  y=[-1,0,1] --&gt;  y(:,:,1,1)=-1, y(:,:,1,2)=0, y(:,:,1,3)=1
  </code></pre>
  
  <p>I would like to avoid for loops.</p>