# TITLE: Matrix Multiplication # AUTHOR: Roy F.A. Maclean # EMAIL: rfamgm at gmail # WEB: http://www.spiderpixel.co.uk/caspro # DATE: 21Jul2007 # MAKE: CASIO # MODEL: 7400 # NOTES: # # To multiply ( 1 2 3 ) by ( 1 0 ) # ( 4 5 6 ) ( 2 5 ) # ( 1 7 ) # # Enter [1 2 3 4 5 6] into List 1 and [1 0 2 5 1 7] into List 2 # # Then run the program and enter: # 2 for List 1 Rows, 3 for List 1 Cols # 3 for List 2 Rows, 2 for List 2 Cols # # Then the result will be displayed: # 8 # 31 # 20 # 67 # which represents the matrix ( 8 31 ) # ( 20 67 ) # as the number of result rows=number of rows of 1st matrix, # and the number of result cols=number of cols of 2nd matrix. # # -> represents the assgnment arrow # => represents the implies double: [SHIFT][VARS][F3][F3] # <> represents not equals symbol: [SHIFT][VARS][>][>][F1][F2] # _ represents the display symbol: [SHIFT][VARS][>][F2] @@ Program "MATMULT" Lbl 0 ClrText "MAT IN LIST 1" "ROWS"?->P "COLS"?->Q ClrText "MAT IN LIST 2" "ROWS"?->R "COLS"?->S If Q<>R Then ClrText "COLS MAT 1<>" "ROWS MAT 2"_ IfEnd Q<>R=>Goto 0 Seq(0,X,1,PS,1)->List 3 For 1->I To P For 1->J To S 0->T For 1->K To Q List 1[(I-1)Q+K]List 2[(K-1)S+J]+T->T Next T->List 3[(I-1)S+J] Next Next List 3