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

  • 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 35
35
and a Not-a-Number,
N
N
a
a
N
N
,
, is returned in the vector. In the third
case, the inverse of each vector element is required, but Matlab
returns an error since for such operation the “./” and not “/”
should have been used instead.
Example: Examine the following limit:
xx
xx
x
e
e
ee
lim
+
Matlab’s command:
>>x=[0.5 1 5 25 50 100 300];
>>(exp(x)-exp(-x))./(exp(x)+exp(-x))
Matlab’s response:
ans =
0.4621 0.7616 0.9999 1.0000 1.0000 1.0000 1.0000
Comments:
Apparently, the limit converges to unity.
The dot power of vectors works in a similar way as with other dot products.
Usually there is the need to square (or to rise to some other power) the
elements of a vector. This can be done with the dot power operation as
explained in the following example set.
Matlab’s command:
>> d_power=sqrt(0:log(3):6)
>> d_power.^2, d_power.^4, d_power.* d_power, ans.*ans
Matlab’s response:
d_power =
0 1.0481 1.4823 1.8154 2.0963 2.3437
ans =
0 1.0986 2.1972 3.2958 4.3944 5.4931
ans =
0 1.2069 4.8278 10.8625 19.3112 30.1737
ans =
0 1.0986 2.1972 3.2958 4.3944 5.4931
ans =
0 1.2069 4.8278 10.8625 19.3112 30.1737
Zobrazit stránku 35
1 2 ... 31 32 33 34 35 36 37 38 39 40 41 ... 118 119

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

Žádné komentáře