MATLAB FINANCIAL DERIVATIVES TOOLBOX Uživatelský manuál Strana 30

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 119
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 29
29
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.
Zobrazit stránku 29
1 2 ... 25 26 27 28 29 30 31 32 33 34 35 ... 118 119

Komentáře k této Příručce

Žádné komentáře