Skip to content

flipdim

Flip an array along the specified dimension.

B = flipdim(A, dim)

Reverses the order of elements along dimension dim. flipdim(A, 1) is flipud(A); flipdim(A, 2) is fliplr(A). For higher dimensions, useful when you need to reverse a specific axis of an N-D array.

A = reshape(1:24, [2 3 4]);
flipdim(A, 3); % reverse along the 3rd dimension
  • fliplr — Flip an array left-to-right (reverse columns).
  • flipud — Flip an array upside down (reverse rows).
  • rot90 — Rotate a matrix 90 degrees counter-clockwise.