This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country 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. The resulting array A has the same values as B 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.


collapse all

Create a 2-by-2-by-3 array A, and compute its permutation P according to the vector v. The inverse permutation of P is equivalent to the original array A.

A = rand(2,2,3);
v = [3 2 1];
P = permute(A,v);
IP = ipermute(P,v);
ans = logical


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

Extended Capabilities

See Also

Introduced before R2006a