MATLAB FINANCIAL DERIVATIVES TOOLBOX Manual de usuario Pagina 64

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 119
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 63
63
-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
Comments:
Creating the 3D mesh and a 3D surface. The function is not smooth
because the dense of the
x
x and
y
y was too low.
With the above code, a 3D mesh and a 3D surface is created. It is apparent
that the surfaces are not smooth because the original density of
x
x and
y
y
vectors was too low. In the following, we re-create the mesh and surface with
higher densities.
Matlab’s command:
>> x=-2:0.25:2; y=-4:0.5:4; [X,Y]=meshgrid(x,y);
>> 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'); title('Peaks')
>> figure(2); surf(X,Y,Z); xlabel('x'); ylabel('y'); zlabel('Z'); title('Peaks');
Vista de pagina 63
1 2 ... 59 60 61 62 63 64 65 66 67 68 69 ... 118 119

Comentarios a estos manuales

Sin comentarios