Da Wikiversità, l'apprendimento libero.
% istogramma
x=0:15;
bar(x);
print -dpng "c:\\bar.png"
|
x=[3,5,10];
y=[23,44,52];
bar(x,y)
print -dpng "c:\\bar1.png"
|
t=0:0.01:10*pi;
x=t.*sin(t);
y=t.*cos(t);
z=t;
plot3(x,y,z,'k','linewidth',1);
grid on;
xlabel('x');ylabel('y');zlabel('z');
print -dpng "c:\\plot3xyz.png"
|
x=-pi:0.1:pi;
y= -pi:0.1:pi;
[X,Y]=meshgrid(x,y);
Z= 2.^(-1.5*sqrt(X.^2+Y.^2.)).*sin(X).*sin(Y);
surf(X,Y,Z);
xlabel('x');ylabel('y');zlabel('z');
print -dpng "c:\\surfxyz_m.png"
|
tx = ty = linspace ( -8, 8, 41)';
[xx, yy] = meshgrid (tx, ty);
r = sqrt (xx .^ 2 + yy .^ 2) + eps;
tz = sin (r) ./ r;
mesh (tx, ty, tz);
print -dpng "c:\\meshxyz_m.png"
|