Introduction Functions  Environments:-  J  Matlab Mathematica Maple APL HP48G TI85 TI89
Function definitions on the HP48G 
sample: « ® a b n « 'X' 'X' a b '(b-a)/n' EVAL SEQ »»

d: « DLIST »

mids: « 2 « a b '(a+b)/2' » DOSUBS » 

sum: « SLIST »

S: « {{0}}SWAP + « ® s t « s s s SIZE GET t + + »» STREAM » 

VS: « OBJ ® ® ARRY SWAP OBJ ® ® ARRY 2 COL ® 'SDAT' STO »

Notice that functions d and sum have equivalent primitive functions on this calculator. After storing the programs under the given name (a directory is recommended), they appear on the VAR menu softkeys. Users would press keys (with arguments on the stack) to create lists and then store them under appropriate names: X, Y, DX, DY, XM, YM, etc.  One drawback is that the notation doesn't actually appear as on a computer screen, for example, SY= S(ym*dx)  is entered with the keystrokes: 
    YM DX * S 'SY' STO 
The PLOT menu choice of  Type: Scatter will plot each point in the matrix, SDAT. The program VS will take any lists Y and X off the stack and store them in SDAT. For example, to plot SY vs X enter keystrokes: 
    SY X VS    PLOT   ERASE    DRAW 
To superimpose multiple graphs, simply omit ERASE. Connecting the points is not an option.
Arithmetic and scientific functions on lists are applied to each element except for one bad inconsistency in the + key.  Multiplication, for example, is entered with the keystrokes: 
  YM DX *
Indeed, entering 'EXP(-X)*SIN(2*X)' EVAL will create a Y list for the stored variable X list. Unfortunately, the + key joins or augments lists rather than adding componentwise. The desired operation is ADD on the MTH LIST menu and an alternative is the SEQ function to create tables. Ironically, an easy way to avoid this hassle is to always subtract negatives; 
    'SIN(X^ 2 - -2*X - -3)' EVAL will work where 'SIN(X^2 + 2*X + 3)' fails.
  [Readers with browsers that display fonts different to ours should note that 
® is intended to be a right pointing arrow,  that  «  is equivalent to  <<  and   » to   >> .]
Introduction Functions Environments:-  J  Matlab Mathematica Maple APL HP48G TI85 TI89