Applying A Program To An Array - HP 48gII Advanced User's Reference Manual

Graphing calculator
Hide thumbs Also See for 48gII:
Table of Contents

Advertisement

12 `56 `˜šš
45 `1 `
9 `14 `
`
Select the VAR menu and execute MNX2.
J %MNX2%
Find the minimum element.
%MIN%

Applying a Program to an Array

APLY makes use of list processing to transform each element of an array according to a desired procedure. The
input array must be numeric, but the output array may be symbolic.
The procedure applied to each element must be a program that takes exactly one argument (i.e. the element) and
returns exactly one result (i.e. the transformed element).
Level 2
Techniques used in APLY
Manipulating Meta-Objects. Meta-objects are composite objects like arrays and lists that have been
!
disassembled on the stack. APLY illustrates several approaches to manipulating the elements and dimensions
of such objects.
Application of List Processing. APLY makes use of DOSUBS (although DOLIST might also have been
!
used) to perform the actual transformation of array elements.
Using an IFERR...THEN...ELSE...END Structure. The entire symbolic pseudo-array case is handled
!
within a error structure — triggered when the "ARRY command generates an error when symbolic elements
are present.
Using Flags. User flag 1 is used to track the case when the input array is a vector.
!
APLY program listing
Program:
«
 a p
«
2-20 RPL Programming Examples
Level 1
[ array ]
« program »
Comments:
Store the array and program in local variables.
Begin the main local variable structure.
"
Level 1
[[ array ]] or {{ array }}
"

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

49g+

Table of Contents