MATLAB FINANCIAL DERIVATIVES TOOLBOX Manual do Utilizador Página 63

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 119
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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 página 62
1 2 ... 58 59 60 61 62 63 64 65 66 67 68 ... 118 119

Comentários a estes Manuais

Sem comentários