; IDL Version 7.1.1 (linux x86_64 m64) ; Journal File for mats@sally ; Working directory: /home/mats/idl/develop/matrixalgebra ; Date: Thu Apr 5 16:19:19 2012 ;Check array dimensions with size( ,/dim): ;A: 3 ;B: 1 3 ; ; ;================================ With the # operator: ; ;------ |A| (op:#) [3x1] ------ ; 0 ; 1 ; 2 ;------------------------------ ; ;------ |B| (op:#) [1x3] ------ ; 1 3 5 ;------------------------------ ; ;------ |A # B| (op:#) [3x3] ------ ; 0 0 0 ; 1 3 5 ; 2 6 10 ;---------------------------------- ; ;OK, a 3-element column vector times a 3-element row vector is a 3x3 matrix. ; ;------ |B # A| (op:#) [1x1] ------ ; 13 ;---------------------------------- ; ;OK, a row vector times a column vector is a 1x1 matrix. ; ; ;================================ With the ## operator: ; ;------ |A| (op:##) [1x3] ------ ; 0 1 2 ;------------------------------- ; ;------ |B| (op:##) [3x1] ------ ; 1 ; 3 ; 5 ;------------------------------- ; ;------ |A ## B| (op:##) [1x1] ------ ; 13 ;------------------------------------ ; ;OK, a row vector times a column vector is a 1x1 matrix. ; ;------ |B ## A| (op:##) [3x3] ------ ; 0 1 2 ; 0 3 6 ; 0 5 10 ;------------------------------------ ; ;OK, a 3-element column vector times a 3-element row vector is a 3x3 matrix.