MATLAB FINANCIAL DERIVATIVES TOOLBOX Bedienungsanleitung Seite 39

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 119
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 38
38
It is obvious that the above matrix can be decomposed to either 2 row
vectors of 41
×
dimensions or to 4 column vectors of
1
2
X
. So, row and
column vectors are special cases of a two dimensional array (matrix).
If we let, 1
11
=a , 2
21
=a , 2
12
=a , 2
22
=a , 5
13
=a , 4
23
=a ,
3
12
=a and 1
24
=a , then the “A” matrix is reformed to:
=
×
1422
3521
42
A
The subscripts in each element of the matrix denote the element’s position.
For instance, the position of
23
a is 2
nd
row, 3
rd
column. Matlab stores
matrices using this rational. Having in mind that a two dimensional array is
a composition of row vectors, we can use spaces (or commas) to define its
row vectors and semicolons to separate them. The above matrix can be
easily created as follows:
Matlab’s command:
>> A=[ 1 -2 5 -3; -2 2 4 1]
Matlab’s response:
A =
1 -2 5 -3
-2 2 4 1
Comments:
Creation of a 2-by-4 matrix.
To show that row and column vectors are special cases or a two dimensional
array (matrix) elaborate on the following examples:
Matlab’s command:
>> B=linspace(1, 4, 5); C=1:5; D=[-4:-1, NaN, Inf 1];
>> A1=[B; C], A2=[A1; A1], A3=[B -9 -5;D]
Matlab’s response:
A1 =
1.0000 1.7500 2.5000 3.2500 4.0000
1.0000 2.0000 3.0000 4.0000 5.0000
Seitenansicht 38
1 2 ... 34 35 36 37 38 39 40 41 42 43 44 ... 118 119

Kommentare zu diesen Handbüchern

Keine Kommentare