CREATING ARRAY
MLBL2
Creating One-Dimension(Vector)
= 2 + 4 + 5
Vector is created by typing the element inside
square bracket []
example
To make column vector using space
To make row vector using ;
Creating vector with constant
spacing
Example
Vector = 2 4 6 8 10
Fist element 2, spacing
2, last element 10
Creating vector with linear
(equal) spacing
Creating two-dimension array
(Matrik)
5
4
21
35
76
32
43
81
40
Zero, one and eye command
Zero (m x n) = zero all element value
One (m x n) = one all element value
Eye (n)
= diagonal matrik have 1 value
TRANSPOSE OPERATOR
Example(vector)
Example(Matrix)
Array Addressing
Ve(k) is vector with position k (column or row).
Example
Ma(k,p) is matrix with position (k refer to row, p refer to column).
Example:
Manipulation data
Using colon: addressing Arrays
Va(m:n) refers to element m through n of the vector va.
Example:
For Matrix
Example:
Adding element to matrix
Deleted data
Build in functions for handling arrays