MATLAB FINANCIAL DERIVATIVES TOOLBOX Manual de usuario Pagina 63

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 119
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de 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
Vista de pagina 62
1 2 ... 58 59 60 61 62 63 64 65 66 67 68 ... 118 119

Comentarios a estos manuales

Sin comentarios