Data Orientation and Augmentation

Changing the data and put data is very commonly used in the program.. In the other programming language it may be quite difficult. But of course in MATLAB it becomes very easy.

-Changing the orientation of the data by the transpose
>> x = [1 3 5; 2 4 6]
x =

1     3     5
2     4     6

>> x = x'
x =

1     2
3     4
5     6

-Put data on the line.
>> x = [1 3 5;2 4 6]
x =

     1     3     5
     2     4     6

>> y = [7 7 7]
y =
    7     7     7

>> aug = [x;y]
aug =
     1     3     5
     2     4     6
     7     7     7

-Put data on the Column
>> x = [1 3 5; 2 4 6]
x =
     1     3     5
     2     4     6

>> y = [5;5]
y =
    5
    5

>> aug = [x y]
aug =
    1    3    5   5
    2    4    6   5

0 comments:

Post a Comment