Showing posts with label MATLAB. Show all posts
Showing posts with label MATLAB. Show all posts

Tuesday, July 9, 2019

HOW TO GET ALL ROWS DATA OF A COLUMN IN MATLAB

How to get all rows data of a particular column:
 Ex: Daily temperature and humidity data=>data=[256 60
                                                                                 270 80
                                                                                 269 70
                                                                                 265 65]
data(:,1)==>gives the temperature data which presents in the 1st column
        ↓ ↳ 1st column
      all
     rows

data(:,2)==>gives the humidity data which present in the 2nd column
         ↓ ↳ 2nd column
      all
     rows

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.