Vector : A list of objects. Generally, the object is a number. There are row vector and column vector.
A row vector is expressed as [1,2,3,4,5] and a column vector is expressed as [1;2;3;4;5];
The notation of vector is []. The index or subscript starts from 1 and the transpose operation ( ' ) can be used to switch the row vector to the column vector, and vise visa.
Initial a vector.
>> A = [1:10]
A =
1 2 3 4 5 6 7 8 9 10
index the vector with 2:2:8
>> A(2:2:8)
ans =
2 4 6 8
Matrix : A matrix is a rectangular array of numbers (or objects).
M = [1,2,3;4,5,6;7,8,9];
This is a 3x3 matrix. M(1,1)=1 and M(3,3) = 9.
Index: colon notation (:)
>> M = [1,2,3;4,5,6;7,8,9];
>> M(1:2,2:3)
ans =
2 3
5 6
>> M(1:2,:)
ans =
1 2 3
4 5 6
The basic operations can be directly used to Vector and Matrix computations.