
2.1.2 Column Vectors
Column vectors are created via the use of semi-colon “;” instead of commas
and spaces. Operations with column vectors are similar as with row vectors.
The following examples depict the manipulation of column vectors.
Matlab’s command:
>> cv=[1;4;7;9]
Matlab’s response:
cv =
1
4
7
9
Comments:
Creating a four-element column vector.
Matlab’s command:
>> length(cv)
Matlab’s response:
ans =
4
Comments:
Taking the vector’s length.
Matlab’s command:
>> CV=[cv(1:2)+2; cv(2:3)*5]
Matlab’s response:
CV =
3
6
20
35
Comments:
Creating
C
C
V
V that is a four-element column vector. Its first two
elements are the two first elements of
c
c
v
v increased by 2 whereas
the last two elements are the 2
nd
and 3
rd
elements of
c
c
v
v multiplied
by 5.
Kommentare zu diesen Handbüchern