?The fundamental unit of data in MatLab is the array.
èArray:
An array is the collection of data
values organized into rows or columns or both. So Arrays are further classified
according to this difference in dimensions.
ÄRow vector:
These are the one
dimension arrays known as row vectors .they contain collection of data values
organized into 1 row but N columns, so order of a row vector is 1×N.
For example: [1 2 3 4]
Matlab
Declaration of a 1×4 Row vector: a=[1
2 3 4]
Result: a
=1 2 3
4
ÄColumn vector:
These are also
one dimension arrays known as column vectors. They contain collection of data
values organized into 1 column but M rows, so order of column vector is M×1.
MatLab
declaration of a 4×1 column vector: a=[1;2;3;4]
Result:
a = 1
2
3
4
Ä Matrix:
These are two or
multidimensional arrays known as matrix. They contain collection of data values
organized into M rows and also N coulms.so order of a matrix is M×N.
MatLab
declaration of a 2×2 matrix: a=[1 2;3 4]
Result: a = 1 2
3 4
ÄScalars:
These are one dimensional
array known as scalars. Scalars contain collection of data values organized
into 1 row and 1 column only so order of scalar values is 1×1.
Example: [5]
MatLab
declaration of scalar values: a=[5]
Result: a=5
0 comments:
Post a Comment