Skip to content

ipermute

Inverse permute — undo a permute operation.

A = ipermute(B, order)

Inverse of permute. If B = permute(A, order), then A = ipermute(B, order). Equivalent to permute(B, invperm(order)) where invperm is the inverse permutation.

A = magic(3);
B = permute(A, [2 1]);
isequal(ipermute(B, [2 1]), A) % 1
  • permute — Rearrange dimensions of an N-D array.
  • reshape — Reshape an array without changing its data.