Skip to content

flipud

Flip an array upside down (reverse rows).

B = flipud(A)

Reverses the order of rows in A — row 1 becomes the last row, row 2 second-to-last, etc. Equivalent to flipdim(A, 1) for 2D matrices.

flipud([1; 2; 3]) % [3; 2; 1]
flipud([1 2; 3 4]) % [3 4; 1 2]
  • fliplr — Flip an array left-to-right (reverse columns).
  • flipdim — Flip an array along the specified dimension.
  • rot90 — Rotate a matrix 90 degrees counter-clockwise.