beautypg.com

Defining variables, Evaluating variables – HP 48g Graphing Calculator User Manual

Page 71

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

background image

Step 5:

Clear the stack and purge OPTION from memory.

(CLEAR)

1:

n OPT 10 (♦ iHPURG)

Defining Variables

The HP 48’s DEFINE command can create variables from equations

(see chapter 7 for information about creating eciuations). If stack level

1 has an eciuation with this form, 'name = expression'

,

executing

DEFINE stores that expression in that name.

1. Enter an equation of the form 'name = expression'.

2. Press fi^fPEFI (the DEFINE command).

Example:

Use DEFINE to store M*CC in the variable

E

Step 1:

Press Q3

E fET) M C f3T~) 2 f

ENTER).

Step 2:

Press

DEE).

Note that if flag —3 is clear (its default state), DEFINE stores the

expression without evaluation. If you’ve set flag —3, the expression to
be stored is evaluated to a number, if possible, before it’s stored. For
example, the keystrokes
store ’ 1 i;

SKHD create variable

A

and

0 ’ in it if flag —3 is clear, and 2W if flag —3 is set.

Evaluating Variables

To use a variable’s contents in a calculation, the variable must be

evaluated. This is accomplished by pressing the variable’s menu key in

the VAR menu.

Evaluating a variable name calls the object stored in the variable:

■ Name. The name is evaluated (calling its object).

m

Program. The program runs.

■ Directory. The directory becomes the current directory.
■ Other Object. A copy of the object is returned to the stack.

.Example:

Suppose that there are four variables in the current

directory—A containing 2, B containing 5, ALG
containing the expression ' Fl+B ', and ADD2 containing

Memory 5-13

This manual is related to the following products: