;;; matrices.pro: to run this script noninteractively, type ;;; idl < matrices.pro > matrices.out ;;; ;;; will dump output into file matrices.out ;;; ;;; contains some examples of array and matrix manipulation x = [1.0, 2, 3.0] print, 'x=',x A = [[4.0, 5.0, 7.0],[8.1, 6.2, 1.2]] print, 'A=',A A = [[A], [x]] print, 'augmented A=',A D = invert(A) print, 'inv(A)=',D B=transpose(A) print, 'B=',B C = A + B print, 'C=',C C = A##B print, 'C=',C y = C##transpose(x) print, 'y=',y innerprod = x##y print, 'inner product(x,y)=',innerprod outerprod = x#y print, 'outer product(x,y)=',outerprod exit