Applying a function or program to a list (dolist), To run a program or execute functions on lists, Osd 3 g – HP 48g Graphing Calculator User Manual

Page 202

Attention! The text in this document has been recognized automatically. To view the original document, you can use the "Original mode".

Advertising
background image

Example: Concatenate { 3 2 1 } and { 4 5

6

}.

Step 1:

Enter the two lists.

OSD 3 G

D2C1ED1

( E N T E R )

I5DSD 4 fs^ 5 fSKT)

6 ( E N T E R )

Step 2:

Concatenate the lists.

CD

2:

£ 3 2 1 }

1 :

£ 4 5 6 }

I -

£ 3 2 1 4 5 6 }

17

To sybtract, multiply, or diwide corresponding elements of two lists:

1. Enter both lists.

2. Execute the operation.

Applying a Function or Program to a List (DOLIST)

You can run programs or execute functions on groups of lists.

To run a program or execute

functions

on lists:

1. Enter the lists.

2. Enter the number of lists operated on. This number is actually the

number of elements operated on with each iteration of the function
or program.

3. Enter a program or function.

4. Execute DOLIST.

Example: Create 3 lists (a, b, and c) and execute a function that

does the following to each element a,n + (bn x c„).

Step 1:

Enter the lists and the number of lists to be operated on (3).

SldDi

3 2 (SPCl3

(ENTER) OlID 4 fSPCl 5 fSF^

6 (ENTER) OdD 7 (SPC) 8

fSPCl 9(ENTER)3 (ENTER)

l

H O M E J

4 :

£ 1 2 3 }

3 :

£ 4 5 6 }

2 :

£ 7 8 9 }

1 :

3

17-4 Lists and Sequences

Advertising
This manual is related to the following products: