This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Inverse permute dimensions of N-D array


A = ipermute(B,order)


A = ipermute(B,order) is the inverse of permute. ipermute rearranges the dimensions of B so that permute(A,order) will produce B. B has the same values as A but the order of the subscripts needed to access any particular element are rearranged as specified by order. All the elements of order must be unique.


Consider the 2-by-2-by-3 array a:

a = cat(3,eye(2),2*eye(2),3*eye(2))

a(:,:,1) =              a(:,:,2) =
     1     0                 2     0
     0     1                 0     2

a(:,:,3) =
     3     0
     0     3

Permuting and inverse permuting a in the same fashion restores the array to its original form:

B = permute(a,[3 2 1]);
C = ipermute(B,[3 2 1]);


More About

collapse all

Tall Array Support

This function supports tall arrays with the limitation:

Permuting the tall dimension (dimension one) is not supported.

For more information, see Tall Arrays.


permute and ipermute are a generalization of transpose (.') for multidimensional arrays.

See Also

Introduced before R2006a

Was this topic helpful?