Inverse permute dimensions of N-D array
A = ipermute(B,order)
A = ipermute(B,order) is the inverse of
ipermute rearranges the dimensions of
B so that
permute(A,order) will produce
B. The resulting array
A has the same values
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.
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 = rand(2,2,3); v = [3 2 1]; P = permute(A,v); IP = ipermute(P,v); isequal(A,IP)
ans = logical 1
a generalization of transpose (
.') for multidimensional
This function supports tall arrays with the limitation:
Permuting the tall dimension (dimension one) is not supported.
For more information, see Tall Arrays.
Usage notes and limitations:
Does not support cell arrays for the first argument.
See Variable-Sizing Restrictions for Code Generation of Toolbox Functions (MATLAB Coder).
This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
This function fully supports distributed arrays. For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).