beautypg.com

Defining functions that use lists, Defining functions that use lists ,8-13 – HP 50g Graphing Calculator User Manual

Page 270

background image

Page 8-13

In both cases, you can either type out the MAP command (as in the examples
above) or select the command from the CAT menu.

The following call to function MAP uses a program instead of a function as
second argument:

Defining functions that use lists

In Chapter 3 we introduced the use of the DEFINE function ( „à) to
create functions of real numbers with one or more arguments. A function
defined with DEF can also be used with list arguments, except that, any function
incorporating an addition must use the ADD operator rather than the plus sign
(+). For example, if we define the function F(X,Y) = (X-5)*(Y-2), shown here
in ALG mode:

we can use lists (e.g., variables L1 and L2, defined earlier in this Chapter) to
evaluate the function, resulting in:

Since the function statement includes no additions, the application of the
function to list arguments is straightforward. However, if we define the function
G(X,Y) = (X+3)*Y, an attempt to evaluate this function with list arguments (L1,
L2) will fail:

To fix this problem we can edit the contents of variable

@@@G@@@ , which we can list

in the stack by using …

@@@G@@@,