x=randn(1,20); y=x'*x; domain = [-3:0.2:3]; range = [-5:0.2:5]; [x,y] = meshgrid(domain,domain); r = sqrt(x.^2 + y.^2) + 0.00001; z = sin(pi*r)./(pi*r); t = range; s = sinc(t); s2 = s'*s; S = fft(log(t)); title('plot(fft(log(t)))'); plot(S) clg pause(.1) t = 0.1:0.1:100; title('polar(t,t.*log(t))'); polar(t,t.*log(t)) clg pause(.1) % gsplot is another useful plotting routine: title('using gsplot'); gsplot rand (5, 2) clg pause(.1) z = [0:0.05:5]; title('using plot3'); plot3(cos(2*pi*z), sin(2*pi*z), z, ";helix;"); clg pause(.1) [x,y] = meshgrid([-2:.2:2]); Z = x.*exp(-x.^2-y.^2); title('using surf'); surf(x,y,Z,gradient(Z)) clg pause(.1) function [y1,y2] = test(x) y1 = x + 4 title('test'); hold("on"); ## new line ! plot(y1,'1') y2 = 2*x.^2 + 3*x + 2 plot(y2,'2') hold off clg pause(.1) endfunction test([0:.1:3]) x=randn(1,20); title('Messy Random Data grid, without sine'); mesh(x'*x) title('Messy Random Data grid, with sine of same'); hold("on") % plots the next surface on top of the old one: x=sin(x); mesh(x'*x) hold off