Skip to content

fliplr

Flip an array left-to-right (reverse columns).

B = fliplr(A)

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

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