重新安排矩阵的x,y,z , 在二维中就相当于把x,y 对换,在三维中相当于可以把三个坐标的位置互换。
比如A = 
A(:,:,1)=repmat(1,3,3);
A(:,:,2)=repmat(2,3,3);
A(:,:,3)=repmat(3,3,3);
disp(A);
A(:,:,1) =
     1     1     1
     1     1     1
     1     1     1
A(:,:,2) =
     2     2     2
     2     2     2
     2     2     2
A(:,:,3) =
     3     3     3
     3     3     3
     3     3     3
At = permute(A,[3,2,1]);
disp(At);
At(:,:,1) =
     1     1     1
     2     2     2
     3     3     3
At(:,:,2) =
     1     1     1
     2     2     2
     3     3     3
At(:,:,3) =
     1     1     1
     2     2     2
     3     3     3
permute(A,[3,2,1])
原文:http://www.cnblogs.com/guohaoyu110/p/7496341.html