fliplr

Flips an array from left to right.

Category: Language Fundamentals > Matrices and Arrays

Syntax

B = fliplr(A)

Reverses the order of the columns of A.

Description

The first column becomes the last. For a row vector this reverses the whole vector. It equals flip(A, 2) and is also A(:, end:-1:1).

Input arguments

A
Array of any type; for N-D arrays the columns of each page are reversed.

Output arguments

B
Array of the same size as A.

Example

fliplr([1 2 3; 4 5 6])
Output
ans = 2×3

     3     2     1
     6     5     4

See also

flipud flip rot90 circshift