Documentation

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.

ipermute

Inverse permute dimensions of N-D array

Syntax

A = ipermute(B,order)

Description

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.

Examples

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);
isequal(A,IP)
ans = logical
   1

Tips

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

Extended Capabilities

See Also

Introduced before R2006a

Was this topic helpful?