The Museum of HP Calculators

HP Articles Forum

[Return to the Index ]
[ Previous | Next ]


Palmer's Matrix Multi-Tool Extension

Posted by mbrethen on 30 Sept 2012, 4:43 p.m.

In 2008, Palmer O. Hanson, Jr. posted an extension to Stefan Vorkoetter's Matrix Multi-Tool for the HP-35s. Used in conjuction with Stefan's program, it provides additional matrix functions that you would find on an HP-28s or TI-86. This article proposes the following changes to his existing program:

  1. Adds a new option to call Stefan's program
  2. Makes the Utility (MOV), Math, Identity Matrix and Transpose routines callable as subroutines from other programs
  3. Removes vector multiplication (available in Stefan's Matrix Multi-Tool)
  4. Shortens menus (where practical) to fit the display
  5. Pressing R/S without selecting a choice will return you to the previous menu

Using the Program:

Start the program by pressing XEQ N ENTER. This will display the main menu:

1M 2U 3+ 4O5Ab

The menu choices are:

  1. Norm (magnitude) computation menu for matrix A.
  2. Utility functions menu.
  3. Arithmetic functions menu.
  4. Matrix operations menu.
  5. Input/output using Matrix Multi-Tool.

Pressing R/S without selecting a choice exits the program.

Utility Functions

Press 2 R/S from the main menu to display the utility functions menu:

1>C  2C>  3XC 4>D  5D>  6XD

The menu choices are:

  1. Store the contents of Matrix A in Matrix C.
  2. Recall the contents of Matrix C to Matrix A.
  3. Exchange the contents of Matrix C with the contents of Matrix A.
  4. Store the contents of Matrix A to Matrix D.
  5. Recall the contents of Matrix D to Matrix A.
  6. Exchange the contents of Matrix D with the contents of Matrix A.

Matrix Math Functions

Press 3 R/S from the main menu to display the math functions menu:

1A*C  2A+C  3A-C

The menu choices are:

  1. Multiply the contents of Matrix A times the contents of Matrix C.
  2. Add the contents of Matrix A and Matrix C.
  3. Subtract the contents of Matrix C from the contents of Matrix A.

Performing Matrix Operations

Press 4 R/S from the main menu to display the matrix operations menu:

1DP 2Id 3K 4At

The menu choices are:

  1. Compute the Dot Product of Matrix A and Matrix C.
  2. Replace the contents of Matrix A with an Identity Matrix.
  3. Fill the elements of Matrix A with a constant value, K.
  4. Perform the transpose of Matrix A.

Matrix Multi-Tool Input/Output

Press 5 R/S from the main menu to run the Matrix Multi-Tool program.

Program usage is discussed in more detail here. Verification exercises are also provided.

Program Listing

N001     LBL N
N002     CLx
N003     SF 10
N004     EQN 1M 2U 3+ 4O5Ab
N005     CF 10
N006     x=0?
N007     RTN
N008     1
N009     x=y?
N010     GTO N028
N011     x<>y
N012     2
N013     x=y?
N014     GTO N125
N015     x<>y
N016     3
N017     x=y?
N018     GTO N212
N019     x<>y
N020     4
N021     x=y?
N022     GTO N314
N023     x<>y
N024     5
N025     x=y?
N026     GTO N419
N027     GTO N001
N028     CLx
N029     SF 10
N030     EQN 1ABS 2COL 3ROW
N031     CF 10
N032     x=0?
N033     GTO N001
N034     1
N035     x=y?
N036     GTO N046
N037     x<>y
N038     2
N039     x=y?
N040     GTO N063
N041     x<>y
N042     3
N043     x=y?
N044     GTO N090
N045     GTO N028
N046     RCL N
N047     x^2
N048     1
N049     
N050     1E3
N051     
N052     STO I
N053     0
N054     RCL (I)
N055     x^2
N056     +
N057     ISG I
N058     GTO N054
N059     SQRTx
N060     STO A
N061     VIEW A
N062     GTO N028
N063     RCL N
N064     1
N065     
N066     1E3
N067     
N068     STO I
N069     STO J
N070     CLx
N071     ENTER
N072     0
N073     RCL (I)
N074     ABS
N075     +
N076     ISG I
N077     GTO N073
N078     x<y?
N079     x<>y
N080     RCL N
N081     1E3
N082     
N083     STO+ I
N084     x<>y
N085     ISG J
N086     GTO N072
N087     STO C
N088     VIEW C
N089     GTO N028
N090     RCL N
N091     STO I
N092     1
N093     
N094     1E3
N095     
N096     STOx I
N097     STO J
N098     RCL N
N099     1E5
N100     
N101     STO+ I
N102     CLx
N103     ENTER
N104     0
N105     RCL (I)
N106     ABS
N107     +
N108     ISG I
N109     GTO N105
N110     x<y?
N111     x<>y
N112     RCL N
N113     x^2
N114     1
N115     
N116     STO- I
N117     1E-3
N118     STO+ I
N119     REGZ
N120     ISG J
N121     GTO N104
N122     STO R
N123     VIEW R
N124     GTO N028
N125     CLx
N126     SF 10
N127     EQN 1>C  2C>  3XC 4>D  5D>  6XD
N128     CF 10
N129     x=0?
N130     GTO N001
N131     1
N132     x?y?
N133     GTO N136
N134     XEQ N165
N135     GTO N125
N136     x<>y
N137     2
N138     x?y?
N139     GTO N142
N140     XEQ N175
N141     GTO N125
N142     x<>y
N143     3
N144     x?y?
N145     GTO N148
N146     XEQ N185
N147     GTO N125
N148     x<>y
N149     4
N150     x?y?
N151     GTO N154
N152     XEQ N167
N153     GTO N125
N154     x<>y
N155     5
N156     x?y?
N157     GTO N160
N158     XEQ N177
N159     GTO N125
N160     x<>y
N161     6
N162     x=y?
N163     XEQ N187
N164     GTO N125
N165     XEQ N204
N166     GTO N168
N167     XEQ N196
N168     RCL(I)
N169     STO(J)
N170     1
N171     STO+ J
N172     ISG I
N173     GTO N168
N174     RTN
N175     XEQ N204
N176     GTO N178
N177     XEQ N196
N178     RCL(J)
N179     STO(I)
N180     1
N181     STO+ J
N182     ISG I
N183     GTO N178
N184     RTN
N185     XEQ N204
N186     GTO N188
N187     XEQ N196
N188     RCL(I)
N189     x<>(J)
N190     STO(I)
N191     1
N192     STO+ J
N193     ISG I
N194     GTO N188
N195     RTN
N196     RCL N
N197     ENTER
N198     x^2
N199     +
N200     1
N201     +
N202     STO J
N203     GTO N206
N204     0
N205     STO J
N206     RCL N
N207     x^2
N208     STO+ J
N209     1
N210     
N211     1E3
N212     
N213     STO I
N214     RTN
N215     CLx
N216     SF 10
N217     EQN 1A*C  2A+C  3A-C
N218     CF10
N219     x=0?
N220     GTO N001
N221     1
N222     x?y?
N223     GTO N227
N224     XEQ N238
N225     XEQ N185
N226     GTO N215
N227     x<>y
N228     2
N229     x?y?
N230     GTO N233
N231     XEQ N287
N232     GTO N215
N233     x<>y
N234     3
N235     x=y?
N236     XEQ N289
N237     GTO N215
N238     RCL N
N239     ENTER
N240     x^2
N241     *
N242     4
N243     
N244     2
N245     +
N246     INTG
N247     STO T
N248     VIEW T
N249     RCL N
N250     ENTER
N251     x^2
N252     2
N253     *
N254     +
N255     STO E
N256     RCL N
N257     1
N258     
N259     1E3
N260     
N261     STO V
N262     RCL N
N263     STO J
N264     x^2
N265     STO+ J
N266     STO+ J
N267     STO I
N268     STO+ I
N269     1
N270     STO- J
N271     STO- I
N272     
N273     1E3
N274     
N275     STO+ I
N276     RCL (I)
N277     STO (J)
N278     DSE J
N279     DSE I
N280     GTO N276
N281     XEQ M403
N282     ISG V
N283     GTO N262
N284     CF 0
N285     CF 2
N286     RTN
N287     1
N288     GTO N290
N289     -1
N290     STO S
N291     RCL N
N292     x^2
N293     STO J
N294     1
N295     
N296     1E3
N297     
N298     STO I
N299     RCL (I)
N300     RCL (J)
N301     RCL S
N302     *
N303     +
N304     STO (J)
N305     1
N306     STO+ J
N307     ISG I
N308     GTO N299
N309     XEQ N185
N310     RTN
N311     CL x
N312     SF 10
N313     EQN 1DP 2Id 3K 4At
N314     CF 10
N315     x=0?
N316     GTO N001
N317     1
N318     x=y?
N319     GTO N337
N320     x<>y
N321     2
N322     x?y?
N323     GTO N327
N324     XEQ N361
N325     XEQ N185
N326     GTO N311
N327     x<>y
N328     3
N329     x=y?
N330     GTO N376
N331     x<>y
N332     4
N333     x=y?
N334     XEQ N388
N335     XEQ N185
N336     GTO N311
N337     RCL N
N338     x^2
N339     STO J
N340     1
N341     
N342     1E3
N343     
N344     STO I
N345     0
N346     RCL (I)
N347     RCLx (J)
N348     +
N349     1
N350     STO+ J
N351     Rdn
N352     ISG I
N353     GTO N346
N354     ENTER
N355     SF 10
N356     EQN DP =
N357     PSE
N358     CF 10
N359     STOP
N360     GTO N311
N361     XEQ M199
N362     CLx
N363     DSE J
N364     STO (J)
N365     DSE I
N366     GTO N363
N367     1
N368     STO (J)
N369     RCL+ N
N370     STO+ J
N371     RCL J
N372     RCL E
N373     x>y?
N374     GTO N367
N375     RTN
N376     INPUT K
N377     RCL N
N378     x^2
N379     STO I
N380     1
N381     STO- I
N382     RCL K
N383     STO (I)
N384     RCL I
N385     x?0?
N386     GTO N380
N387     GTO N311
N388     RCL N
N389     x^2
N390     STO W
N391     STO J
N392     1
N393     
N394     1E3
N395     
N396     STO I
N397     RCL (I)
N398     STO (J)
N399     RCL N
N400     STO+ J
N401     x^2
N402     2
N403     *
N404     RCL J
N405     x<y?
N406     GTO N411
N407     1
N408     STO+ W
N409     RCL W
N410     STO J
N411     ISG I
N412     GTO N397
N413     RTN
N414     CF 0
N415     XEQ M001
N416     GTO N001

Length = 1428; Checksum = 9CDF

Note: The keystrokes to enter the superscript "t" in line N313 are: (yellow left shift key) CONST "atm" ENTER BACKSPACE LEFT-CURSOR BACKSPACE ENTER

Revision History

2012 Sep 30 Initial release.

2012 OCT 02 Made the Utility (MOV), Math, Identity Matrix and Transpose routines callable.

2012 OCT 09 Removed the matrix-vector product Ab function. This is available in the main menu of the Matrix Multi-Tool program, which is more convenient for viewing results.

2012 OCT 29 No longer use flag to switch between matrix store/recall.

Edited: 29 Oct 2012, 6:22 p.m.

Password:

[ Return to the Message Index ]

Go back to the main exhibit hall