[TOC]

ipermute

Rearranging dimensions

Usage

b = ipermute(a, order)

Examples

Input
a = rand(3,4);
b = permute(a,[3 1 4 2 5]);
c = ipermute(b,[3 1 4 2 5]);

% a and c have the same sizes
size(a),size(c)

% a and c are the same matrices
a - c
Output
ans = 
 3.0000   4.0000

ans = 
 3.0000   4.0000   1.0000   1.0000   1.0000

ans = 
 0.0000   0.0000   0.0000   0.0000
 0.0000   0.0000   0.0000   0.0000
 0.0000   0.0000   0.0000   0.0000