So I'm trying to create a program able to interpolate from a list of values (more like a matrix) where the left column correspond to the value A and the right column to the value F(A) and so on, then if I'm interest on the value F(B) knowing B the program should do a linear interpolation between F(A) and F(C), I'm not familiar with programming on RPL I'm used to visual so I hope you guys can give me some hints so I'll do it myself.

Additional info:

I've a HP50g

I'm writing my codes on HPuseredit 6

@ Paste in the HPUserEdit and send to emulator

@ "sigma" is the greek letter sigma (somatory); caracter number 133.

[@ A F(A) B F(B)

[ 1 03.3 10 05.1 ]

[ 3 09.2 20 10.2 ]

[ 5 15.1 30 15.3 ]

[ 7 21.2 40 20.1 ]

]

'sigmaDAT' STO

@ sigmaDAT is the variable that contains the current statistical matrix.

{

3. @ column number specifying the independent-variable: "B"

4. @ column number specifying the dependent-variable: "F(B)"

0. @ intercept

0. @ slope

LINFIT @ regression model

}

'sigmaPAR' STO

@ sigmaPAR is the variable that contains the current statistical parameter list.

LR @ Linear Regression command

@ You'll get in the stack:

@ Level 2: Intercept: .15

@ Level 1: Slope: .501

@ 'F(B)=0.15+0.501*B'

@ NOTE:

@ use real numbers in sigmaPAR, not integers. That is:

@ use { 3. 4. 0. 0. LINFIT } and not { 3 4 0 0 LINFIT }.

Perhaps the best option to estimate values is the Fit Data Input Form:

[Right-Shift] [STAT] (3.Fit data..) [PRED]

or, to access it from a program, use:

# 3A002h FLASHEVAL and then press [PRED]

!!!WARNING!!! !!!WARNING!!! !!!WARNING!!!

# 3A002h FLASHEVAL only 49 series (49G, 48GII, 49G+ e 50G).

To the 48G/GX/G+ use # B417Fh LIBEVAL and then [PRED]

SYSEVAL, LIBEVAL and FLASHEVAL can cause calculator memory crash.

Look entries in:

http://www.area48.com/48entries.html
http://www.hpcalc.org/details.php?id=3248