Friday, February 3, 2017

FLIPUD & FLIPLR COMMANDS IN MATLAB

    1. fliplr command is used to reverse the data from left to right.
    Please find  example below.

    Example:

    a=[ 0 0.1 .2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1]

    Command:

    b = fliplr(a)

    output:
    b=[1 0.9 0.8 0.7 0.60.5 0.4 0.3 0.2 0.1 0]

    2. flipud command is used to reverse the data from up to down.
    Please find  example below.

    Example:
      if the data is as below
      c=[ 0
          0.1
          0.2
          0.3
          0.4
          0.5
          0.6
          0.7
          0.8
          0.9
          1 ]


      Command:

      d= flipud(a)

      output:

      d=[1
          0.9
          0.8
          0.7
          0.6
          0.5
          0.4
          0.3
          0.2
          0.1
          0 ]

      Note : These commands are case sensitive.





      No comments: