Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Graficas 2D y 3D
x
Ejemplo: f(x) = x2
x=linspace(-5,5,10);
y=x.^2;
plot(x,y)
¿?
Ejemplo: f(x) = x2
x=linspace(-5,5,100);
y=x.^2;
plot(x,y)
Gráficas 3D
x y f(x,y)
x1 y1 f(x1,y1) f(x2,y1) f(xn,y1)
x2 y2 f(x1,y2) f(x2,y2) f(xn,y2)
x3 y3 f(x1,y3) f(x2,y3) f(xn,y3)
. . . . .
. . . . .
. . . . .
xn ym f(x1,ym) f(x2,ym) f(xn,ym)
Gráficas 3D
f(x,y)
x1 x2 x3 ... xn
y1 x
y2
y3
ym
y
¿Parecido?
Gráficas 3D
f(x,y)
x1 x2 x3 ... xn
y1 x
y2
y3
ym
y
Puntos con un mismo valor de y
Gráficas 3D
f(x,y)
x1 x2 x3 ... xn
y1 x
y2
y3
ym
y
Puntos con un mismo valor de x
Ejercicio 2: Graficar
f(x,y)
x1 x2 x3 ... xn
y1 x
y2
y3
ym
f(x,y)
x1 x2 x3 ... xn
y1 x
y2
y3
ym
y
Ejemplo utilizando plot3d: f(x,y) = x2+ y2
Ejemplo utilizando plot3d: f(x,y) = x2+ y2
x y z=f(x,y)
x1 y1 f(x1,y1) f(x1,y2) f(x1,ym)
x2 y2 f(x2,y1) f(x2,y2) f(x2,ym)
x3 y3 f(x3,y1) f(x3,y2) f(x3,ym)
. . . . .
. . . . .
. . . . .
xn ym f(xn,y1) f(xn,y2) f(xn,ym)
x=linspace(-2,2,100);
y=linspace(-3,3,150);
Al usar plot3d z(i,j)=f(x(i),y(j))
for i=1:length(x)
for j=1:length(y)
z(i,j)=x(i)^2+ y(j)^2;
end
end
Ejemplo: f(x,y) = x2+ y2
plot3d( x, y, z);
e = gce();
e.color_flag = 1;
f = gcf()
f.color_map= jetcolormap(32)
Ejemplo utilizando mesh: f(x,y) = x2+ y2
x1 x2 x3 xn
x
1 x2 x3 xn
x1 x2 x3 xn
x x2 x3
xn
1
m n
Ejemplo utilizando mesh: f(x,y) = x2+ y2
y1 y1 y1 y1
y
2 y2 y2 y2
y3 y3 y3 y3
y ym ym ym
m
m n
Ejemplo utilizando mesh: f(x,y) = x2+ y2
x=linspace(-2,2,100); Dominio
y=linspace(-3,3,150);
[X,Y]=meshgrid(x,y); Dominio
Matricial
Z=X.^2+Y.^2; Valores de la función
mesh(X,Y,Z);
e = gce();
e.color_flag = 1;
f = gcf()
f.color_map= jetcolormap(32)
Ejemplo utilizando mesh: f(x,y) = x2+ y2
Curvas de nivel: f(x,y) = x2+ y2
x=linspace(-2,2,100);
y=linspace(-3,3,150);
for i=1:length(x)
for j=1:length(y)
z(i,j)=x(i)^2+ y(j)^2;
end
end
contour(x,y,z,10)
Curvas de nivel: f(x,y) = x2+ y2
Curvas de nivel: f(x,y) = x2+ y2
contour(x,y,z,10)
10 curvas de nivel!
Curvas de nivel: f(x,y) = x2+ y2