Matrix Example test 5, Function test

Description

GSB 5
Tests MATRIX 0 to MATRIX 9 functions.
Scalar operations 2x, 1-, 2+ and 5/
Matrix multiplication and division
I have used random number entry to avoid problems with matrices containing numbers derived from 1, 2, 3, 4 etc. This makes the intervals between derived numbers in other Matrices the same, which causes problems with some operations.
I saved a copy of [C] in [E] for later use. This avoids problems with the LU form.

Results:
[A] contains [C]/[C] which should be the identity matrix. Note [C] was refreshed from [E]
[B] contains the result of the scalar operations, above, on [A]
[C] contains the LU from RCL MATRIX C, f MATRIX 9 on [C]
[D] contains result from [C]x[C]
[E] contains the original matrix [C]

To read matrix [A] elements again, press GSB A
To read matrix [B] elements again, press GSB B
To read matrix [C] elements again, press GSB C
To read matrix [D] elements again, press GSB D
To read matrix [E] elements, press GSB E


R7 contains the result from f MATRIX 7 on [B]
R8 contains the result from f MATRIX 8 on [B]
R9 contains the result from f MATRIX 9 on [C]

USER mode during programming allows indexed STO and RCL of matrix elements. The f MATRIX 0 statement is also essential.
Once the STO and RCL loops reach the dimensioned size of the matrix the GOTO statement is skipped and the next part of the program runs.

I have added RCL MATRIX E, STO MATRIX C after step 58 and the simulator now creates an identity matrix in [A]

John Patterson
jepattersonatactrix.co.nz
http://www.jepspectro.com

Program Resources

Labels

Name Description Name Description
 A .1 STO random numbers into [A]
 B .2 RCL elements from [B]
 C .3 RCL elements from [C]
 D .4 RCL elements from [D]
 E .5
 5 GSB 5 .6 RCL elements from [A]

Storage Registers

Name Description
 7 Contains the result from f MATRIX 7 on [B]
 8 Contains the result from f MATRIX 8 on [B]
 9 Contains the result from f MATRIX 9 on [C]

Flags

Number Description
8 gCF8 Clear complex number flag

Program

Line Display Key Sequence Line Display Key Sequence Line Display Key Sequence
000 040 10 ÷ 080 42 31 f PSE
001 42,21, 5 f LBL 5 041 45,16,12 RCL MATRIX B 081 42,16, 9 f MATRIX 9
002 43, 5, 8 g CF 8 042 32 12 GSB B 082 44 9 STO 9
003 42,16, 0 f MATRIX 0 043 42 31 f PSE 083 43 32 g RTN
004 2 2 044 45,16,11 RCL MATRIX A 084 42,21,11 f LBL A
005 42 31 f PSE 045 45,16,12 RCL MATRIX B 085 42,16, 1 f MATRIX 1
006 36 ENTER 046 42,26,13 f RESULT C 086 42,21, .1 f LBL . 1
007 4 4 047 42,16, 5 f MATRIX 5 087 42 31 f PSE
008 42,23,11 f DIM A 048 45,16,13 RCL MATRIX C 088 u 45 11 USER RCL A
009 42,16, 1 f MATRIX 1 049 32 13 GSB C 089 22 .1 GTO . 1
010 45,16,11 RCL MATRIX A 050 42 31 f PSE 090 43 32 g RTN
011 42,21, .6 f LBL . 6 051 45,16,13 RCL MATRIX C 091 42,21,12 f LBL B
012 42 31 f PSE 052 44,16,15 STO MATRIX E 092 42,16, 1 f MATRIX 1
013 42 36 f RAN # 053 45,16,13 RCL MATRIX C 093 42,21, .2 f LBL . 2
014 2 2 054 42,26,14 f RESULT D 094 42 31 f PSE
015 0 0 055 20 × 095 u 45 12 USER RCL B
016 20 × 056 45,16,14 RCL MATRIX D 096 22 .2 GTO . 2
017 u 44 11 USER STO A 057 32 14 GSB D 097 43 32 g RTN
018 22 .6 GTO . 6 058 42 31 f PSE 098 42,21,13 f LBL C
019 42 31 f PSE 059 45,16,15 RCL MATRIX E 099 42,16, 1 f MATRIX 1
020 45,16,11 RCL MATRIX A 060 44,16,13 STO MATRIX C 100 42,21, .3 f LBL . 3
021 42 31 f PSE 061 42 31 f PSE 101 42 31 f PSE
022 42,16, 2 f MATRIX 2 062 45,16,13 RCL MATRIX C 102 u 45 13 USER RCL C
023 42 31 f PSE 063 42,26,11 f RESULT A 103 22 .3 GTO . 3
024 42,16, 3 f MATRIX 3 064 10 ÷ 104 43 32 g RTN
025 42 31 f PSE 065 45,16,11 RCL MATRIX A 105 42,21,14 f LBL D
026 42,16, 4 f MATRIX 4 066 32 11 GSB A 106 42,16, 1 f MATRIX 1
027 42 31 f PSE 067 42 31 f PSE 107 42,21, .4 f LBL . 4
028 42,16, 4 f MATRIX 4 068 45,16,12 RCL MATRIX B 108 42 31 f PSE
029 42 31 f PSE 069 42 31 f PSE 109 u 45 14 USER RCL D
030 42,26,12 f RESULT B 070 42,16, 7 f MATRIX 7 110 22 .4 GTO . 4
031 45,16,11 RCL MATRIX A 071 44 7 STO 7 111 43 32 g RTN
032 2 2 072 42 31 f PSE 112 42,21,15 f LBL E
033 20 × 073 45,16,12 RCL MATRIX B 113 42,16, 1 f MATRIX 1
034 1 1 074 42 31 f PSE 114 42,21, .5 f LBL . 5
035 30 075 42,16, 8 f MATRIX 8 115 42 31 f PSE
036 2 2 076 44 8 STO 8 116 u 45 15 USER RCL E
037 40 + 077 42 31 f PSE 117 22 .5 GTO . 5
038 1 1 078 45,16,13 RCL MATRIX C 118 43 32 g RTN
039 0 0 079 42,26,13 f RESULT C