Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the 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`. 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.

## 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.