ipermute
Inverse permute array dimensions
Syntax
Description
Examples
3-D Array
Create a 4-by-3-by-2 array B
, and compute its inverse permutation according to the dimension order [3 1 2]
.
rng default
B = rand(4,3,2)
B = B(:,:,1) = 0.8147 0.6324 0.9575 0.9058 0.0975 0.9649 0.1270 0.2785 0.1576 0.9134 0.5469 0.9706 B(:,:,2) = 0.9572 0.4218 0.6557 0.4854 0.9157 0.0357 0.8003 0.7922 0.8491 0.1419 0.9595 0.9340
A = ipermute(B,[3 1 2])
A = A(:,:,1) = 0.8147 0.9572 0.6324 0.4218 0.9575 0.6557 A(:,:,2) = 0.9058 0.4854 0.0975 0.9157 0.9649 0.0357 A(:,:,3) = 0.1270 0.8003 0.2785 0.7922 0.1576 0.8491 A(:,:,4) = 0.9134 0.1419 0.5469 0.9595 0.9706 0.9340
The inverse permutation A
is the array such that, when you permute it using the same dimension order, the result is equal to the original array B
.
C = permute(A,[3 1 2])
C = C(:,:,1) = 0.8147 0.6324 0.9575 0.9058 0.0975 0.9649 0.1270 0.2785 0.1576 0.9134 0.5469 0.9706 C(:,:,2) = 0.9572 0.4218 0.6557 0.4854 0.9157 0.0357 0.8003 0.7922 0.8491 0.1419 0.9595 0.9340
Input Arguments
B
— Input array
vector | matrix | multidimensional array
Input array, specified as a vector, matrix, or multidimensional array.
dimorder
— Dimension order
row vector
Dimension order, specified as a row vector with unique, positive integer elements representing the dimensions of the input array.
Extended Capabilities
Tall Arrays
Calculate with arrays that have more rows than fit in memory.
This function supports tall arrays with the limitation:
Permuting the tall dimension (dimension one) is not supported.
For more information, see Tall Arrays for Out-of-Memory Data.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
Dimension order must be compile-time constant for heterogeneous cell array inputs. For more information, see Code Generation for Cell Arrays (MATLAB Coder).
See Variable-Sizing Restrictions for Code Generation of Toolbox Functions (MATLAB Coder).
Thread-Based Environment
Run code in the background using MATLAB® backgroundPool
or accelerate code with Parallel Computing Toolbox™ ThreadPool
.
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
The ipermute
function
fully supports GPU arrays. To run the function on a GPU, specify the input data as a gpuArray
(Parallel Computing Toolbox). For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Distributed Arrays
Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™.
This function fully supports distributed arrays. For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)