We have moved to @ Placement Papers Hub !! Visit our new website here for more..

Flipping fliplr flipud Matlab


Matlab Matrix Flipping

*B = fliplr(A) returns A with columns flipped in the left-right direction, that is, about a vertical axis.

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

Like
>> A=[1 2; 4 5; 7 8]

A =

     1     2
     4     5
     7     8

>> B=fliplr(A)

B =

     2     1
     5     4
     8     7

>> C=[1 2 4 6 7]

C =

     1     2     4     6     7

>> D=fliplr(C)

D =

     7     6     4     2     1

>> E=[3; 8; 7]

E =

     3
     8
     7

>> F=fliplr(E)

F =

     3
     8
     7

*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.


>> A=[2 3 4; 2 4 1; 5 6 4]

A =

     2     3     4
     2     4     1
     5     6     4

>> B=flipud(A)

B =

     5     6     4
     2     4     1
     2     3     4