To create a user-defined function, Nesting user-defined functions -8, 'cmb(n)=2"n-l – HP 48g Graphing Calculator User Manual

Page 139

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

Advertising
background image

The DEFINE command lets you create a user-defined function

directly from an equation. The equation must have the form

' name<■ . arguments') = expression '.

Creating a User-Defined Function

To create a user-defined function:

1. Enter an equation that specifies the function name and its

arguments on the left side, and the expression that defines the
calculation on the right side. On the left side, use commas to

separate multiple arguments.

2. Press f^fPEF) (the DEFINE command).

Example:

Use DEFINE to create CMB, a user-defined function that
calculates the number of combinations C of n different
items taken 1, 2, 3, ... w at a time: O = 2” — 1.

Step 1:

Enter the equation for CMB.

0(3(3

CMB

(3)0

a)N

(3(3

Q© 2 (O ©fi) N Q1

(

e n t e r

)

11:

'CMB(n)=2"n-l'

Step 2:

Execute DEFINE. Select the VAR menu and note that it

now contains the user-defined function CMB.

aicMD

( V A R 1

11

Executing a User-Defined Function

A user-defined function is executed j ust like a built-in function—it

can take numeric or symbolic arguments, either from the stack or in

algebraic syntax.

Using Mathematical Functions 11-7

Advertising
This manual is related to the following products: