Beruflich Dokumente
Kultur Dokumente
2 −x 2
f x , y= y e
PRESENTACIÓN
En cada diapositiva se exponen las instrucciones a realizar
en la ventana de comandos del Matlab para obtener una
superficie.
>> [x,y]=meshgrid(-4:.25:4);
>> z=y.^3;
>> surf(x,y,z)
>> axis square
>> xlabel('Eje X'),ylabel('Eje Y'),zlabel('Eje Z')
>> [x,y]=meshgrid(-2:.1:2);
>> surf(x,y,-x+y,'FaceColor','blue')
>> hold on
>> surf(x,y,2.*x+y-1,'FaceColor','red')
>> legend('Plano z=-x+y','Plano z=2x+y-1')
Hold on
es para realizar
una gráfica
sobre otra
x− yz=0
2x y−z=1
Adolfo Canahuire Condori
Dos cilindros parabólicos
>> [x,y]=meshgrid(-10:.5:10);
>> z=4-y.^2;w=4-x.^2;surf(x,y,z)
>> hold on
>> surf(x,y,w)
2
w=4− x
Hold on
es para realizar
una gráfica
sobre otra
2
z=4− y
>> [x,y]=meshgrid(-3*pi:.25:3*pi);
>> z=sin(sqrt(x.^2+y.^2));
>> surf(x,y,z)
>> axis([-3*pi 3*pi -3*pi 3*pi -2 2])
>> colormap bone
Con el colormap
“bone” se proporciona
una escala de grises
2 2 −x 2− y 2
−x 2− y 2 f x , y= x y e
f x , y=−xy e
Adolfo Canahuire Condori
Superficie con sus curvas de nivel
>> [x,y]=meshgrid(-4:.1:4);
>> surfc(x,y,exp(-x.^2)+exp(-y.^2))
>> axis([-4 4 -4 4 -0.5 2])
>> view(60,-15),axis off Para borrar los
ejes
Estos valores se
obtienen con
“clabel”
El color de las
curvas de nivel
varian desde la
parte superior
(rojo) a las parte Número de curvas
inferior (azul) de nivel
>> [x,y]=meshgrid(-2:.1:2);
>> z=exp(-x.^2-y.^2);
>> [C,h]=contour(x,y,z,7),axis square
>> clabel(C,h)
>> title('Curvas de nivel de z=e^{-x^2-y^2}','FontSize',14)
Superficie de revolución
>> t=0:.1:4;[x,y,z]=cylinder(sqrt(t));
>> subplot(1,2,1)
>> plot(t,sqrt(t))
>> axis square,title('Curva que genera la superficie')
>> subplot(1,2,2)
>> surf(x,y,z),axis vis3d
>> title('Superficie')
2
2 x
y − =1
4
2
Para no mezclar x, y, z de t
la función cylinder, es que f t = 1
se usa la variable t 4 Adolfo Canahuire Condori
>> t=0:.05:1;
Conos >> [x,y,z]=cylinder(t);[X,Y,Z]=cylinder(2*t);
>> subplot(1,2,1)
>> plot(t,t,t,2*t),axis([0 1 0 3])
>> axis square
>> subplot(1,2,2)
>> surf(x,y,z,'FaceColor','blue')
>> hold on
>> surf(X,Y,Z,'FaceColor','green')
>> axis vis3d
>> t=0:.1:2;[x,y,z]=cylinder(t,3);
>> subplot(1,2,1)
>> surf(x,y,-z),axis vis3d,axis off
>> title('Tetraedro','Fontsize',14)
>> subplot(1,2,2)
>> surf(x,y,z),axis vis3d,axis off
>> title('Tetraedro invertido','Fontsize',14)
>> subplot(2,2,1)
>> ezsurf('x^2+y^2'),axis square
Paraboloides >> subplot(2,2,2)
>> ezsurf('x^2+y^2','circ'),axis square
>> subplot(2,2,3)
>> ezsurf('4-x^2-y^2'),axis square
>> subplot(2,2,4)
>> ezsurf('4-x^2-y^2','circ'),axis square
se usa la f ro ejemplos
ur f
unción ezs
uat
grafica la superficie
sobre un disco
centrado en el
dominio de la
función
Dominio
0u2
Ecuación
0v cartesiana
x2 y 2 z2
2
2 2 =1
a b c
2 2 2
x y z
2
2
2
=1
5 2 1
0u2
0v/2