Está en la página 1de 5

1

HOJA DE TRABAJO MÉTODOS NUMÉRICOS

ESTUDIANTE: CARNÉ:
1. ______________________________________________________________________

Instrucciones: Grafica con MATLAB las siguientes funciones en 3D. Imprimir en formato
.pdf y unir los archivos, subir un archivo compilado a la plataforma.

Grafique las siguientes funciones en una misma figura, generando las siguientes tipos de
gráfica:

(a) Malla
(b) Superficie
(c) Contorno
(d) Combinación de superficie y contorno.
* Colocar todos los atributos vistos en clase a las gráficas generadas (nombre, etiquetas de
ejes, cambio de colores a su discreción)

1
2 1
2

ING. MANUEL SALVADOR BOLAÑOS


MATLAB Command Window Page 1

>> %Alberto Aldair Guzman Tesucun


>> %1690-20-5448
>> %a)z=senxy
>> x=[-5:0.5:5];
>> y=[-5:0.5:5];
>> [X Y]=meshgrid(x,y);
>> Z=sin(X.*Y);
>> %-----Malla
>> subplot(2,2,1)
>> mesh(X,Y,Z)
>> title('Malla'),xlabel('eje x'), ylabel('eje y'), zlabel('eje z')
>> colormap(cool)
>> %Superficie
>> subplot(2,2,2)
>> surf(X,Y,Z)
>> title('Gráfica de Superficie'),xlabel('eje x'), ylabel('eje y'), zlabel('eje z')
>> colormap(cool)
>> %CONTORNO
>> subplot(2,2,3)
>> contour(X,Y,Z)
>> title('CONTROL GRAFICA'),xlabel('eje x'), ylabel('eje y'), zlabel('eje z')
>> colormap(cool)
>> %SUPERFICIE Y CONTORNO
>> subplot(2,2,4)
>> surfc(X,Y,Z)
>> title('Superficie y Contorno'),xlabel('eje x'), ylabel('eje y'), zlabel
('eje z')
Error using zlabel (line 34)
Incorrect number of input arguments

>> title('Gráfica de Superficie y Contorno'),xlabel('eje x'), ylabel('eje y'),


zlabel
('eje z')
Error using zlabel (line 34)
Incorrect number of input arguments

>> title('Gráfica de Superficie y Contorno'),xlabel('eje x'), ylabel('eje y'),


zlabel('eje z')
>> colormap(cool)
>> %b)z=x^2y^2
>> x=[-5:0.5:5];
>> y=[-5:0.5:5];
>> [X Y]=meshgrid(x,y);
>> Z=X.^2.*Y.^2;
>> figure
>> %MALLA
>> subplot(2,2,1)
>> mesh(X,Y,Z)
>> title('GRAFICA DE MALLA'),xlabel('eje x'), ylabel('eje y'), zlabel('eje z')
>> colormap(hot)
>> %SUPERFICIE
>> subplot(2,2,2)
>> surf(X,Y,Z)
MATLAB Command Window Page 2

>> title('Gráfica de Superficie'),xlabel('eje x'), ylabel('eje y'), zlabel('eje z')


>> colormap(hot)
>> %CONTORNO
>> subplot(2,2,3)
>> contour(X,Y,Z)
>> title('Gráfica de Contorno'),xlabel('eje x'), ylabel('eje y'), zlabel('eje z')
>> colormap(hot)
>> %SUPERFICIE Y CONTORNO
>> subplot(2,2,4)
surfc(X,Y,Z)
>> title('Gráfica de Superficie y Contorno'),xlabel('eje x'), ylabel('eje y'),
zlabel
('eje z')
Error using zlabel (line 34)
Incorrect number of input arguments

>> title('Gráfica de Superficie y Contorno'),xlabel('eje x'), ylabel('eje y'),


zlabel ('eje z')
>> colormap(cool)
>> colormap(cool)
>> %c)z=2xy-1/2(x^4+y^4)+1
>> x=[-5:0.5:5];
>> y=[-5:0.5:5];
>> [X Y]=meshgrid(x,y);
>> Z = 2*X*Y - 0.5*(X.^4 + Y.^4) + 1;
>> figure
>> %MALLA
>> subplot(2,2,1)
>> mesh(X,Y,Z)
>> title('Gráfica de Malla'),xlabel('eje x'), ylabel('eje y'), zlabel('eje z')
>> colormap(copper)
>> %SUPERFICIE
>> subplot(2,2,2)
>> surf(X,Y,Z)
>> title('Gráfica de Superficie'),xlabel('eje x'), ylabel('eje y'), zlabel('eje z')
>> colormap(copper)
>> %CONTORNO
>> subplot(2,2,3)
>> contour(X,Y,Z)
>> title('Gráfica de Contorno'),xlabel('eje x'), ylabel('eje y'), zlabel('eje z')
>> colormap(copper)
>> %SUPERFICIE Y CONTORNO
>> subplot(2,2,4)
>> surfc(X,Y,Z)
>> title('SUPERFICIE CONTORNO'),xlabel('eje x'), ylabel('eje y'), zlabel ('eje z')
>> colormap(copper)
>>

También podría gustarte