MATLAB FINANCIAL DERIVATIVES TOOLBOX Manuale Utente Pagina 63

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 119
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 62
62
rectangular domain. The subsequent 2D plot of
X
X and
Y
Y shows
how the grid is sampled.
Now, we should evaluate the
Z
Z at each pair of the grid and generate the
surface plot. This is done with the following code:
Matlab’s command:
>> Z =3*(1-X).^2.*exp(-(X.^2) - (Y+1).^2)- ...
10*(X/5-X.^3-Y.^5).*exp(-X.^2-Y.^2)-1/3*exp(-(X+1).^2-Y.^2);
>> figure(1); mesh(X,Y,Z); xlabel('x'); ylabel('y'); zlabel('Z');
>> figure(2); surf(X,Y,Z); xlabel('x'); ylabel('y'); zlabel('Z');
Matlab’s response:
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
-4
-2
0
2
4
-6
-4
-2
0
2
4
6
x
y
Z
Vedere la pagina 62
1 2 ... 58 59 60 61 62 63 64 65 66 67 68 ... 118 119

Commenti su questo manuale

Nessun commento