RPN Advanced 42 manual · Chapter 10 of 18
Matrices and vectors
Create, edit, invert and multiply matrices, solve linear systems, and use dot and cross products.
10.2Create and edit a matrix#
NEW makes a zero matrix, and EDIT opens it in the matrix editor. The top line shows row:column=value. Type a number and press the right-arrow menu key (→) to store it and move on. ENTER does the same as →: it stores the number and moves to the next element (after the last element it wraps to the first). Press EXIT to leave the editor; your edits are kept.

| Menu key | Label | Action |
|---|---|---|
| Σ+ | INS | Insert a row of zeros before the current row. |
| 1/x | ← | Move left (stores the number you were typing). |
| √x | ↑ | Move up. |
| LOG | ↓ | Move down. |
| LN | → | Move right. |
| XEQ | DEL | Delete the current row. |
The ▲ and ▼ keys also move between rows. Moving past the last cell wraps around to the first.
Build [[1, 2], [3, 4]]
Type 2, ENTER, 2 and press NEW (first key).
2ENTER2⇧MATRIX9Σ+Press EDIT (sixth key). Type each number and press → (fifth key); type the last number and EXIT.
XEQ1LN2LN3LN4EXIT![After step 2: Press EDIT (sixth key). Type each number and press → (fifth key); type the last number and EXIT. The display shows: x: [ 2×2 Matrix ] / NEW INV DET TRN SMQ EDT.](/trident/app/help/manual/img/569a1280s.webp)
![Result of the example "Build [[1, 2], [3, 4]]" The display shows: x: [ 2×2 Matrix ] / NEW INV DET TRN SMQ EDT.](/trident/app/help/manual/img/569a1280s.webp)
[ 2×2 Matrix ]Check the editor shows the values
After building the matrix, open EDIT again and move right.
2ENTER2⇧MATRIX9Σ+XEQ1LN2LN3LN4EXITXEQLN

1:2=2.000010.3Determinant, inverse and transpose#
Determinant of [[1,2],[3,4]]
Build the matrix and press DET (third key).
2ENTER2⇧MATRIX9Σ+XEQ1LN2LN3LN4EXIT√x
![Result of the example "Determinant of [[1,2],[3,4]]" The display shows: x: -2.0000 / NEW INV DET TRN SMQ EDT.](/trident/app/help/manual/img/5d307bfas.webp)
-2.0000Inverse: look at the first entry
Build the matrix and press INV (second key).
2ENTER2⇧MATRIX9Σ+XEQ1LN2LN3LN4EXIT1/xOpen the editor to read it: the first value is −2.
XEQ

1:1=-2.0000Transpose
Build the matrix and press TRN (fourth key); the entry at 1:2 is now 3.
2ENTER2⇧MATRIX9Σ+XEQ1LN2LN3LN4EXITLOGXEQLN

1:2=3.0000For matrices up to 10 × 10, DET, INV, ÷ and SIMQ are worked out exactly from the 12-digit entries and rounded once at the end. So a singular matrix of whole numbers has a determinant of exactly 0, and the inverse of a matrix with simple fractions comes out right to the last digit. Larger matrices use 32-digit elimination.
A singular 3 × 3 matrix
Make a 3 × 3 matrix and fill it with 1 to 9 by rows.
3ENTER3⇧MATRIX9Σ+XEQ1LN2LN3LN4LN5LN6LN7LN8LN9EXITPress DET: the rows depend on each other, so it is exactly zero.
√x

0.0000Its inverse does not exist
Build the same matrix and press INV.
3ENTER3⇧MATRIX9Σ+XEQ1LN2LN3LN4LN5LN6LN7LN8LN9EXIT1/x

Singular Matrix10.4Add, multiply and scale matrices#
The ordinary operations work on matrices: + and − need matrices of the same size, × multiplies a matrix by a number or by a matrix with matching inner size, and ÷ solves a linear system when Y is the right-hand side matrix and X the coefficient matrix.
Square a matrix
Build [[1,2],[3,4]], duplicate it with ENTER and multiply.
2ENTER2⇧MATRIX9Σ+XEQ1LN2LN3LN4EXITEXITEXITENTER×⇧MATRIX9XEQ

1:1=7.0000Multiply by a number
The first entry of 2 times the matrix is 2.
2ENTER2⇧MATRIX9Σ+XEQ1LN2LN3LN4EXITEXITEXIT2×⇧MATRIX9XEQ

1:1=2.000010.5Solve a system of equations#
SIMQ solves . Type the number of equations and press SMQ. The menu offers A (coefficients), B (right-hand sides) and X (the answer). Edit A and B, then press X to compute and show the solution.
Solve x + y = 3 and x − y = 1
Type 2 and press SIMQ (fifth key). Edit matrix A (first key): 1, 1, 1, −1.
2⇧MATRIX9LNΣ+1LN1LN1LN1+/−EXIT
Edit B (second key): 3 and 1.
1/x3LN1EXITPress X (third key). The editor shows x in row 1.
√x

1:1=2.000010.6Dot product, cross product and unit vectors#
A vector is a matrix with one row or one column. DOT needs two vectors of the same length. CRS needs two vectors of length 3. UVC divides a vector by its length.
Dot product of (1,0,0) and (0,1,0)
Build both vectors with NEW 1 × 3 and EDIT.
1ENTER3⇧MATRIX9Σ+XEQ1LN0LN0EXITEXITEXIT1ENTER3⇧MATRIX9Σ+XEQ0LN1LN0EXITOpen page 2 and press DOT.
▼Σ+

0.0000Unit vector of (3, 4)
Build the vector, open page 2 and press UVC (third key).
1ENTER2⇧MATRIX9Σ+XEQ3LN4EXIT▼√xOpen the editor: the first value is 0.6.
⇧MATRIX9XEQ

1:1=0.600010.7Read and write single elements: INDEX, STOIJ, STOEL, RCLEL#
INDEX (page 2, fifth key) chooses a named matrix to work on one element at a time. Its pointer starts at row 1, column 1. Page 3 has STOIJ (move the pointer to row Y, column X), RCLIJ (recall the row and column), STOEL (store X in the element), RCLEL (recall the element), PUTM (copy the matrix in X into it, from the pointer) and GETM (copy out a block of Y rows and X columns). Page 4 has INSR and DELR (insert or delete the row at the pointer), R↔R (swap rows Y and X), GRW and WRP, and DM? (the size of the matrix in X: rows in Y, columns in X). Page 5 has I+, I−, J+ and J− to step the pointer down a column or along a row.
Store and read one element
Make a named 2 × 2 matrix M with DIM, then press INDEX and pick M.
2ENTER2⇧MATRIX9▼LOG√xLOGENTERLNΣ+Go to page 3. Move to row 2, column 1 with STOIJ, store 7 with STOEL and read it back with RCLEL.
▼2ENTER1Σ+7√xLOG

x: 7.000010.8Norms and row sums#
NRM on page 5 opens FNM (the Frobenius norm, the square root of the sum of the squares of all elements) and RNM (the row norm: the largest sum of absolute values in a row). RSM gives a column of the row sums.
Row norm of [[1, −2], [3, 4]]
Build the matrix, go to page 5 (▲ from page 1), press NRM and RNM.
2ENTER2⇧MATRIX9Σ+XEQ1LN2+/−LN3LN4EXIT▲XEQ1/x
![Result of the example "Row norm of [[1, −2], [3, 4]]" The display shows: x: 7.0000 / FNM RNM .](/trident/app/help/manual/img/a7a9a0f4s.webp)
x: 7.0000One-number functions such as x², √x, LN, SIN, ABS, IP, FP, RND and SIGN work on each element of a real matrix. To multiply a matrix by itself, use ENTER ×.
10.9Name and store matrices#
DIM (page 2, fourth key) makes a named matrix of Y rows and X columns. EDN opens a named matrix for editing. A matrix can also be stored with STO into a register or variable, and recalled with RCL.
Make a named 2 by 3 matrix
Type 2, ENTER, 3, open page 2 and press DIM. Type M (group J K L M, fourth key) and ENTER.
2ENTER3⇧MATRIX9▼LOG√xLOGENTERRecall it.
EXITRCL⇧ALPHAENTER√xLOGENTER
![Result of the example "Make a named 2 by 3 matrix" The display shows: y: 3.0000 / x: [ 2×3 Matrix ].](/trident/app/help/manual/img/ba590999s.webp)
[ 2×3 Matrix ]Store a matrix in a register
Build [[1,2],[3,4]], store it in register 00 and recall it.
2ENTER2⇧MATRIX9Σ+XEQ1LN2LN3LN4EXITSTO000RCL00
![Result of the example "Store a matrix in a register" The display shows: x: [ 2×2 Matrix ] / NEW INV DET TRN SMQ EDT.](/trident/app/help/manual/img/5a8c4867s.webp)
[ 2×2 Matrix ]HP-42S is a trademark of HP Inc.. Trident Calculator is an independent product by South View Studios and is not affiliated with, sponsored by or endorsed by HP. The name is used only to describe the kind of calculator this model resembles; Trident's names, keys, display, fonts and software are its own clean-room design.

