pro example ; Here is another program of IDL examples x = findgen(100) ;an array: [0,1,2,...99] for i = 0, 5 do begin ; a FOR loop read,'Type the period of the sine wave (5-100) ',P y = sin(!pi*x/P) ; (!pi = 3.141..) plot,x,y,title = 'Sine wave of Period: '+string(P) endfor ; end of for loop dummy = '' print,'' read,'Hit return to see some random data ',dummy data = 5. * randomn(seed,20) ; 20 random points print,data print,'The average is ', mean(data) print,'The standard deviation is: ',stdev(data) print,'' read,'Hit return to see a 2D bessel function ',dummy x2 = findgen(100)/5 ; an array going from -10 to +10 y2 = beselj(x2) ; the bessel function yy = [reverse(y2),y2] plot,x2,y2,title = 'J Bessel Function' read,'Hit return to see some 3D Bessels!',dummy shade_surf,yy#yy ; # means matrix multiply by the way. end ; end program