Post Reply 
5-Number Summary Calculation for the HP 42s
10-24-2024, 06:17 PM (This post was last modified: 10-24-2024 06:19 PM by Gjermund Skailand.)
Post: #2
RE: 5-Number Summary Calculation for the HP 42s
Hi,

here is a building block that you may find useful.
It sorts a column or matrix using the first column as index.
It illustrates some "advanced" techniques on the HP42S

input on stack: matrix [m,1] or matrix[m,n]
output : sorted matrix

00 { 35-Byte Prgm }
01 LBL "SORT"
02 STO "."
03 INDEX "."
04 1
05 LBL 00
06 [MIN] @ get index and value of minimum row from current position
07 Rd
08 R<>R @ swap current row with the minimum row
09 ISG ST Y
10 CLX @ on DM42, Free42 use NOP
11 Rd
12 I+
13 FC? 76 @ row index not wrapped?
14 GTO 00
15 RCL "."

Notes
Rd means the R_down_arrow
[MIN] must on the HP42s be entered as XEQ "[MIN]", on DM42/Free42 you can find it at end of the CATALOG/FCN menu.
[MIN] searches from indexed position to end of column, returns position of minimum value in Y, and minimum value in X
Similar with [MAX]

In case you want to modify the program to sort on a different column, say i,
then insert after line 4: i STOIJ X<>Y

mvh Gjermund
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: 5-Number Summary Calculation for the HP 42s - Gjermund Skailand - 10-24-2024 06:17 PM



User(s) browsing this thread: 2 Guest(s)