; IDL Version 6.3 (linux x86 m32) ; Journal File for jmcbride@aquarius ; Working directory: /home/jmcbride/idl_class ; Date: Mon Feb 2 18:02:24 2009 x = 15 x=15 print, x ; 15 help, x x=15. help, x x=15l b = 'james' print, b ;james students = ['lucas', 'michelle'] print, students[0] ;lucas morestudents = [students, 'justin', 'mickey'] print, morestudents ;lucas michelle justin mickey b = james ; % Variable is undefined: JAMES. x = findgen(15) print, x ; 0.00000 1.00000 2.00000 3.00000 4.00000 5.00000 ; 6.00000 7.00000 8.00000 9.00000 10.0000 11.0000 ; 12.0000 13.0000 14.0000 print, x[0] ; 0.00000 print, x[0:4] ; 0.00000 1.00000 2.00000 3.00000 4.00000 print, morestudents[0:1] ;lucas michelle print, x[0:4] ^ 2 ; 0.00000 1.00000 4.00000 9.00000 16.0000 y = indarr(5) ; % Variable is undefined: INDARR. y = intarr(5) print, y ; 0 0 0 0 0 x = findgen(15) * 2 print, x ; 0.00000 2.00000 4.00000 6.00000 8.00000 10.0000 ; 12.0000 14.0000 16.0000 18.0000 20.0000 22.0000 ; 24.0000 26.0000 28.0000 x = findgen(15) * 2 + 1 print, x ; 1.00000 3.00000 5.00000 7.00000 9.00000 11.0000 ; 13.0000 15.0000 17.0000 19.0000 21.0000 23.0000 ; 25.0000 27.0000 29.0000 inds = indgen(10) * 2 print, inds ; 0 2 4 6 8 10 12 14 16 18 inds = indgen(7) * 2 print, inds ; 0 2 4 6 8 10 12 print, x[inds] ; 1.00000 5.00000 9.00000 13.0000 17.0000 21.0000 ; 25.0000 help, inds help, x print, 5. ; 5.00000 print, 5d ; 5.0000000 ? for for i = 0, 10 do print, 2 * i ; 0 ; 2 ; 4 ; 6 ; 8 ; 10 ; 12 ; 14 ; 16 ; 18 ; 20 x = findgen(10) print, x ; 0.00000 1.00000 2.00000 3.00000 4.00000 5.00000 ; 6.00000 7.00000 8.00000 9.00000 for i = 0, 9 do x[i] = x[i] * 2 print, x ; 0.00000 2.00000 4.00000 6.00000 8.00000 10.0000 ; 12.0000 14.0000 16.0000 18.0000 x = findgen(10) print, 2 * x ; 0.00000 2.00000 4.00000 6.00000 8.00000 10.0000 ; 12.0000 14.0000 16.0000 18.0000 x = 2 * x print, x ; 0.00000 2.00000 4.00000 6.00000 8.00000 10.0000 ; 12.0000 14.0000 16.0000 18.0000 pwd ls emacs & ; % Attempt to call undefined procedure/function: 'EMACS'. print, fact(1) ; % Variable is undefined: FACT. print, factorial(1) ; 1.0000000 .com forloop.pro forloop, 10 ; 1.0000000 1.0000000 2.0000000 6.0000000 24.000000 ; 120.00000 720.00000 5040.0000 40320.000 362880.00 forloop, 10 ; 1.0000000 1.0000000 2.0000000 6.0000000 24.000000 ; 120.00000 720.00000 5040.0000 40320.000 362880.00 .com forloop.pro forloop, 10 ;The array fact is originally: 0.0000000 0.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 0.0000000 0.0000000 ; 1.0000000 ; 1.0000000 ; 2.0000000 ; 6.0000000 ; 24.000000 ; 120.00000 ; 720.00000 ; 5040.0000 ; 40320.000 ; 362880.00 ; 1.0000000 1.0000000 2.0000000 6.0000000 24.000000 ; 120.00000 720.00000 5040.0000 40320.000 362880.00 .com forloop.pro forloop, 10 ;The array fact is originally: ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 1.0000000 ; 1.0000000 ; 2.0000000 ; 6.0000000 ; 24.000000 ; 120.00000 ; 720.00000 ; 5040.0000 ; 40320.000 ; 362880.00 ; 1.0000000 1.0000000 2.0000000 6.0000000 24.000000 ; 120.00000 720.00000 5040.0000 40320.000 362880.00 print, intarr(3) ; 0 0 0 help, intarr(3) help, dblarr(3) if 7 gt 5, print 'yes' ; % Syntax error. if 7 gt 5 do print 'yes' ; % Syntax error. ? if if 7 gt 5 then print, 'yes' ;yes if 7 > 5 then print, 'yes' ;yes if 7 < 5 then print, 'yes' ;yes if 0 then print, 'yes' if 1 then print, 'yes' ;yes if 2 then print, 'yes' if 3 then print, 'yes' ;yes if \4 then print, 'yes' ; % Illegal character in program text. if 4 then print, 'yes' if 7 eq 8 then print, 'yes' print, 5 mod 2 ; 1 print, 4 mod 2 ; 0 .com forloop forloop, 10 ;The array fact is originally: ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 1.0000000 ; 1.0000000 ; 2.0000000 ; 6.0000000 ; 24.000000 ; 120.00000 ; 720.00000 ; 5040.0000 ; 40320.000 ; 362880.00 ; 1.0000000 0.0000000 2.0000000 0.0000000 24.000000 ; 0.0000000 720.00000 0.0000000 40320.000 0.0000000 .com forloop forloop, 10, 2 ;The array fact is originally: ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 1.0000000 ; 2.0000000 ; 24.000000 ; 720.00000 ; 40320.000 ; 1.0000000 0.0000000 2.0000000 0.0000000 24.000000 ; 0.0000000 720.00000 0.0000000 40320.000 0.0000000 .com forloop forloop, 10, 2 ;The array fact is originally: ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 0.0000000 ; 1.0000000 ; 2.0000000 ; 24.000000 ; % Attempt to subscript FACT with I is out of range. print, i ; 6 help, fact retall .com forloop forloop, 10, 2 ;The array fact is originally: ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 1.0000000 ; 2.0000000 ; 24.000000 ; 720.00000 ; 40320.000 ; 1.0000000 0.0000000 2.0000000 0.0000000 24.000000 ; 0.0000000 720.00000 0.0000000 40320.000 0.0000000 .com forloop forloop, 10, 2 ;The array fact is originally: ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 1.0000000 ; 2.0000000 ; 24.000000 ; 720.00000 ; 40320.000 ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 forloop, 10,3 ;The array fact is originally: ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 1.0000000 ; 6.0000000 ; 720.00000 ; 362880.00 ; 0.0000000 0.0000000 0.0000000 6.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 362880.00 stepSize = 10 limit = 3 forloop, stepSize, limit ;The array fact is originally: ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 1.0000000 ; 6.0000000 ; 720.00000 ; 362880.00 ; 0.0000000 0.0000000 0.0000000 6.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 362880.00 .com forloop stepSize = 3 limit = 10 forloop, limit = limit, stepSize = stepSize ;The array fact is originally: ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 1.0000000 ; 6.0000000 ; 720.00000 ; 362880.00 ; 0.0000000 0.0000000 0.0000000 6.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 362880.00 forloop, stepSize = stepSize, limit = limit ;The array fact is originally: ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 1.0000000 ; 6.0000000 ; 720.00000 ; 362880.00 ; 0.0000000 0.0000000 0.0000000 6.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 362880.00 forloop, stepSize = 3, limit = 10 ;The array fact is originally: ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 ; 1.0000000 ; 6.0000000 ; 720.00000 ; 362880.00 ; 0.0000000 0.0000000 0.0000000 6.0000000 0.0000000 ; 0.0000000 0.0000000 0.0000000 0.0000000 362880.00 print, 5 mod 2 ; 1 print, 5 / 2 ; 2 print, 5 / 2. ; 2.50000 print, 5 / 2.0 ; 2.50000