MATLAB FINANCIAL DERIVATIVES TOOLBOX Instrukcja Użytkownika Strona 34

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 119
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 33
33
The dot product in Matlab is performed via the “.*” symbol. By the use of dot
product we can get the inner product. This is explained in the following
examples:
Matlab’s command:
>> dprod1=w.*u', dprod2=u'.*u'.* w
Matlab’s response:
dprod1 =
2 0 -4 -0.5
dprod2 =
4 0 8 -0.25
Comments:
Producing the dot product of various operations. For example
d
d
p
p
r
r
o
o
d
d
1
1 is computed as:
d
d
p
p
r
r
o
o
d
d
1
1=[1*2, 0*4, 2*(-2), (-1)*0.5].
Matlab’s command:
>> inner1=sum(w.*u'), inner2=sum((2+w).*(u'/2))
Matlab’s response:
inner1 =
-2.5
inner2 =
3.25
Comments:
Producing the summation of dot product of various operations.
When the
s
s
u
u
m
m function is used with a dot product, the result is
the inner product of that operation.
In vector manipulations, dot product is performed after dot power (see the
following section).
2.1.4.3 Dot Division and Power
The dot division does not exist mathematically, but for programming
purposes, Matlab includes such operation. The dot division can be used to
divide a vector with another vector of similar characteristics and also to
divide a vector with a scalar. Through the following examples the use of dot
division is outlined. Pay attention on the cases where a dot division
produces pathological results.
Przeglądanie stron 33
1 2 ... 29 30 31 32 33 34 35 36 37 38 39 ... 118 119

Komentarze do niniejszej Instrukcji

Brak uwag