Skip to Main Content Skip to Search
Product Documentation

flipud - Flip matrix up to down

Syntax

B = flipud(A)

Description

B = flipud(A) returns A with rows flipped in the up-down direction, that is, about a horizontal axis.

If A is a column vector, then flipud(A) returns a vector of the same length with the order of its elements reversed. If A is a row vector, then flipud(A) simply returns A.

Examples

If A is the 3-by-2 matrix,

A =
    1    4
    2    5
    3    6

then flipud(A) produces

    3    6
    2    5
    1    4

If A is a column vector,

A =
    3
    5
    7

then flipud(A) produces

A =
    7
    5
    3

Limitations

The array being operated on cannot have more than two dimensions. This limitation exists because the axis upon which to flip a multidimensional array would be undefined.

See Also

flipdim | fliplr | rot90

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS