Вы находитесь на странице: 1из 2

Ejem 1

alpha=0:pi/80:8*pi;

z=alpha/8;

x=z/(8*pi)+z.*cos(alpha);

y=z/(8*pi)+z.*sin(alpha);

plot3(x,y,z)

ejem2

x = [-2.1:0.15:2.1];

y=[-6:0.15:6];

[x,y] = meshgrid(x,y);

z = 80*y.^2.*exp(-x.^2-0.3*y.^2);

mesh(x,y,z)

Ejem 3

clear,clf;

x=[-2:0.2:2];

y=[-2:0.2:2];

[x,y]=meshgrid(x,y);

z=x.*exp(-x.^2-y.^2);

subplot (1,2,1);

mesh(x,y,z),title(‘grafica mesh’);

xlabel(‘eje x’), ylabel(‘eje y’), zlabel(‘eje z’);

subplot (1,2,2);

surf(x,y,z), title(‘grafica de superficie’);

Ejem 4

x=-10:0.5:10;

y= x;

[x,y] = meshgrid(x,y);

z = sin(sqrt(x.^2 + y.^2)) ./sqrt(x.^2 + y.^2 + 0.1);

contour(x,y,z);

colorbar;

figure
contour3(x,y,z);

colorbar;

Ejem 5

close all

u= -8:0.5:8; v=u;

[u,v] = meshgrid(u,v);

r = sqrt(u.^2+v.^2)+eps;

w = sin(r)./r;

mesh(w)

figure

surf(w)

Ejem6

x = linspace(pi/4,2*pi,50);

[x,y] = meshgrid(x,x);

z = (cos(x)./x).*(sin(y)./sqrt(y));

contour(z,20)

figure

contour3(z,20)

Вам также может понравиться