MATLAB FINANCIAL DERIVATIVES TOOLBOX Manuel d'utilisateur Page 63

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 119
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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
Vue de la page 62
1 2 ... 58 59 60 61 62 63 64 65 66 67 68 ... 118 119

Commentaires sur ces manuels

Pas de commentaire