To add, subtract, multiply, or divide two binary integers
To find the negative of a binary integer
To convert a binary integer to a different number base
To convert a binary integer to a real number.............................8-4
To convert a real number to a binary integer.............................8-4
Using Boolean operators ....................................................................8-5
Manipulating bits and bytes ..............................................................8-6
corresponding elements of two lists............................................9-4
Applying a fimction or program to a list ...........................................9-5
To run a program or execute a function on lists
To apply a procedure sequentially to elements of a list
To execute a function on every element of a list
..........................
.............
.........................
List Manipulations...............................................................................9-7
The HP 49G documentation set is made up of the following components:
• User’s Guide, available witli the calculator.
• Pocket Guide, available with the calculator.
« Advanced Topics, being chapters 1 to 13 of this manual, and available
from the web site.
® CAS Commands, being chapter 14 of this manual, and available from
the web site.
® Other Commands A to F, available from the web site.
® Other Commands G to P, available from the web site.
® Other Commands Q to Z, available from the web site.
NOTICE
This manual and any examples contained herein are provided as is and are subject to change
without notice. Except to the extent prohibited by law, Hewlett-Packard Company makes no
express or implied wairanty of any kind with regard to this manual and specifically disclaims
the implied warranties and conditions of merchantability and fitness for a particular purpose
and Hewlett-Packard Company shall not be liable for any errors or for incidental or
consequential damage in comiection with the furnishing, performance or use of this manual
and the examples herein.
There are a ramrber of ways you can enter a command:
• by pressing the key or keys for the command
• by selecting the command from a subject-specific menu
® by selecting the command from the command catalog
• by typing the command on the command line.
Keyboard entry
The most commonly needed commands can be entered directly from the
keyboard by pressing one or two keys. For example, to enter the SIN
command, press the
See chapter 1 of the User’s Guide for an explanation of each key on the
HP 49G keyboard.
(SIN)
key; to enter the LOG command, press (r)(iog).
Subject-specific menus
The HP 49G provides a number of menus that list just those commands
relevant to a specific topic.
For example, all the programming commands are collected together on
the programming menu. You access this menu by pressing I
Other subject-specific menus include a:
® math menu (0 (MTH))
® symbolic solve menu (0 (SSg))
® exponential and logarithm menu (0 (B(M)j
® trigonometry menu (0 (HG))
® calculus menu (0 (0£))
® algebra menu (0 (ALG))
® matrices menu (0 (MMIS)j
® statistics menu (0 (SW))
® convert menu (0 @3))
Entering commands
Page 1-1
units menu i
arithmetic menu i
complex number menu (0 SEE))
base menu (0 {№
Tliese subject-specific menus have keys allocated to them on the
keyboard.
There are many other subject-specific menus. For example, the math
menu and the various Computer Algebra System sub-menus can be
selected from the Applications menu:
1. Press ®.
The Applications menu is displayed.
2. Press ®.
The last page of the Applications menu is displayed.
3. Highlight the menu you want—mathor CAS—and press OK or (ENTER)
Both menus are made up of several sub-menus, each listing the
commands of relevance to a particular area of mathematics.
The symbolic menu (displayed by pressing
(SYMB)j
provides a series of sub
menus each listing the more conunonly used commands of relevance to a
particular area of mathematics: algebra, arithmetic, calculus and so on.
Sub-menus
Some entries on a subject-specific menu
are shortcuts to sub-menus. For example,
pressing 0(MTH) displays the mathmenu.
The first item on the mathmenu is vector.
The two periods after the word “vector”
indicates that there is a imtlier menu. This
further menu lists conunands of relevance to vector mathematics (such as
ABS, dot, cross, etc).
Page 1-2
RfiD
HATH HEnu
iHOH
a.HRTRiK..
3.LIST..
H.HVF'ERfOLICS..
5.RERL..
e.EfiSE..
Entering commands
Entering a command From a sub-menu
With the main menu displayed, highlight the name of the sub-menu.
1
You can do this by:
® pressing ® imtil the sub-menu name is highlighted or
• pressing the number key that corresponds to the number of the
sub-menu. For example, to highlight the REAL sub-menu in the
above example you could press 5.)
2.
Press OK or
(ENTER).
The sub-menu is displayed.
3. Highlight the name of the command you want to enter.
You can do this by:
® pressing @ rmtil the command name is highlighted or
• pressing the number key that corresponds to the number of the
command.
4. Press OK or (EN
If you are working in algebraic mode, the command you selected appears
on the command line ready for you to specify arguments.
If you are working in RPN mode, the result of the conunand appears on
the stack.
Entering a command from a Function key menu
A subject-specific menu can take the form of a choose list (as described in
the previous section) or a frmction key menu. A fmiction key menu is one
that appears across the bottom of the screen, with items chosen from the
menu by pressing the corresponding function key: (£1) to (£6).) This is
explained in chapter 2 of the User’s Guide.
Entering commandsPage 1-3
Command catalog
The HP 49G provides a single choose list that contains all its commands.
This is called the command catalog.
Displaying the command catalog
1. Press
A choose list is displayed. This is the
command catalog.
RAD
CATAlD(i: 6S3 CtiHHADDS
■ :hoh
K
HCH
¿1
2. Locate the command that you want to
enter. (See the next section.)
isnsiKn
3. Press OK or (MS)If you are working in algebraic mode, the command you selected
appears on the command line ready for you to specify arguments.
If you are working in RPN mode, the result of the conunand appears on
the stack.
Locating a command in the command catalog
There are two ways to locate a conunand in the command catalog;
® by scrolling
® by searching on the first character or first few characters of the
command.
Scrolling through the catalog
To scroll through the command catalog, press the (3 or (a) keys. Keep
doing so until the command you want is highlighted.
You can use the shift keys in conjimction with the arrow keys to scroll
more quickly through the catalog. For example:
0® displays the last command in the catalog
0® displays the first conunand
0® displays the next page of commands
0® displays the previous page of conunands.
The niunber of commands displayed per page is determined by flag -90.
When set—which is the default—the commands are displayed in the mini
font. This gives you six conunands per page. If flag -90 is cleared, the
Page 1-4
Entering commands
commands are displayed in your currently selected system font. If, for
example, you have chosen System 8 as your current system font, you will
see only four commands per page.
Searching For a command in the command catalog
The majority of commands can be selected from the command catalog by
searching on the first character of the command’s name.
1. Press the keys for the first character—or first few characters—of the
command’s name.
For example, to find tire HALFTAN command, type (SM) H or
(EES (M) HA.
The first command with a name starting with the letter or letters you
typed will be highlighted.
2. If the conunand you want is not highlighted, press @ imtil the
command is highlighted.
Note that the first character of a command’s name may be:
• an upper-case character (for example, SIN)
• a lower-case character (for example, rref), or
® a symbol (for example —>TAG).
The type of the first character determines the best way to search for the
command.
Upper case: if the command you want to find begins with an upper-case
letter, you must press
(ALPHA)
before pressing the key for that letter. If you
intend to search by typing the first few characters of the command name,
you will need either to:
• hold the (MA) key down while you key all the characters, or
® lock the alpha keyboard before you type the characters.
Lower case: if the command you want to find begins with a lower-case
Non-alphabetic characters: if the command you want to find begins with a
non-alphabetic character, press the keys for that character. For example,
to search for ^TAG, type 00. The first command with a name that
starts with ^ is displayed. (In this example, you need to press ® until
^TAG is highlighted.)
Entering commands
Page 1-5
While the alpha keyboard is active, you can also search for a command
that begins with a special character by typing that character and then one
or more of the next alphabetical characters.
The keystrokes for non-alphabetic characters can be fomid in the
Characters catalog. For example, the keystrokes for Z are 0 and S.
Therefore, to search for the E+ command in the command catalog, you
display the catalog and press 0 S.
The Characters catalog- accessed by pressing
'—is explained in
chapter 2 of the User’s Guide.
Note that you can import additional commands from third-party
conunand libraries. When a library is attached, the commands in the
library will appear in the conunand catalog. If any such conunand begins
with a character that is not available directly from the HP 49G keyboard,
you will not be able to search for the command.
Typing commands
In addition to selecting a command from tire conunand catalog or from a
menu, you can also enter a conunand by typing its name on the conunand
line.
For example, to factorize an expression while in algebraic mode, you
could:
1. type igP0(IPHA)FACTOR00
2. enter the expression
3.
press
To factorize an expression while in RPN mode, you could:
1. enter the expression onto level 1 of the stack
2. type
3. press (ENTER).
(ENTER).
(SMldPHA)
FACTOR
Every command found in the command catalog can be entered directly
from the keyboard.
Some conunand names contain special characters (for example, ^ and
Z). The Characters catalog—accessed by pressing
0¡CHARS)
and explained
in chapter 2 of the User’s Guide—shows the keystrokes needed to enter
special characters.
Page 1-6Entering commands
Chapter 2
System Flags
System flags provide you with some control over how the HP 49G behaves
and displays infomiation. For example, by setting flag
the alpha keyboard by pressing
-60
retimrs the mode to its default setting (where
(SM)
once rather than twice. Clearing flag
twice to lock the alpha keyboard).
-60,
you can lock
(IPHA)
must be pressed
Displaying system Flags
02 Constint ■ * 5yHb
1.
Press
(MODE)
to display the Calculator
Modes input form.
2.
Press FLAGS.
The System Flags list is displayed. A tick
to the left of a flag number indicates that the flag is set. If the space to
the left of a flag number is empty, the flag is clear. Fi'om this screen
you can set or clear any flag in the list.
The System Flags list is not a list of all the system flags. As a general rule,
flags that are likely to be changed often can be set or cleared on various
input forms, where they are more readily accessible. Flags that will rarely
be changed are listed in the System Flags list.
For example, flag -95 deteraiines whether the calculator is in algebraic or
RPN mode. As this is a flag that many users are likely to want to change
from time to time, it is accessible from an input form; the Calculator
Modes input fonn (described in chapter 2 of the User’s Guide}. Because it
is accessible from an input fonn, flag -95 is not listed in the System Flags
list. (There are some exceptions to this general rule, with some flags
accessible both from an input form and from the System Flags list.)
All the system flags—not just those on the System Flags list—are listed
and described in the HP 49G Pocket Guide.
03 Function ■+ iyMb
IH P<3yH«rit ifid
13 ,4J,i2 ■ + uictc-r
20 Un-3«i-F U->H 0
21 0M.grFU.H -«• ±5EH?5___________+
System flags
Page 2-1
Setting and clearing Flags
Method 1
Use this method only if the flag you want to change is listed in the System
Flags list.
1. With the System Flags list displayed, higlilight the flag that you want to
set or clear.
You can do this by either:
® pressing the ® or ® keys imtil the flag you want is highlighted or
• typing the first digit of the number of the flag.
See the previous section for instructions on displaying the flags.
2. Press CHK.
If the flag was set before, it is cleared; if it was clear before, it is now
set.
3. Press OK or (ENTE^ to return to the Calculator Modes screen and OK or
(ENTER) again to return to yom default screen.
Method 2
If you know the number of the system flag you want to change, you can
change the flag from the command line. The syntax you use depends on
the operating mode you have chosen: algebraic or RPN.
In algebraic mode, the syntax is:
commandijlag)
In RPN mode, enter the flag on the first level of the stack and then enter
the appropriate command. The command for setting a flag is SF and the
command for clearing a flag is CF. (The flag commands are described on
page 2-4.)
For example, to set flag -40 in algebraic mode, you enter SF(-40) and
press (ENTER). In RPN mode, you enter -40 onto level 1 of the stack, enter SF
onto the command line and press (ENTER).
Similarly, to clear flag ^0 in algebraic mode, you enter CF(-40) and press
(ENTER). In RPN mode, you enter -40 onto level 1 of the stack, enter CF onto
the command line and press (ENTER).
You can use this method to set and clear all flags, not just those listed on
the System Flags list.
Page 2-2
System flags
Setting or clearing several Flags at once
In algebraic mode, the syntax is:
command^llist}')
In RPN mode, enter a list of the flags you want to set or clear on the first
level of the stack and then enter the appropriate command.
For example, to set flags -19 and-40 in algebraic mode, you enter
SF({-19,-401) and press
1 of the stack, enter SF onto the command line and press
(ENTER).
In RPN mode, you enter {-19 ^0} onto level
(ENTER')
. (Note that
in algebraic mode, you must enter a comma between the elements in a list.
In RPN mode, you can enter a comma or a space.)
Similarly, to clear flags -19 and-40 in algebraic mode, you enter
CF({-19,-40j) and press
level 1 of the stack, enter CF onto the command line and press
(ENTER).
In RPN mode, you enter {-19 -40{ onto
(ENTER).
Method 3
The flags that you are likely to need to change can be changed from
various input fonns (as explained on page 2-1). To change one of these
flags, display the appropriate input fonn, place the cursor in the flag field
and press CHK. If the flag was set before, it is cleared; if it was clear before,
it is now set. (A tick mark in the field indicates that the flag is set.)
Examples of flags that can be set from input forms include operating
mode, number format, angle measure, coordinate system, beep, key click,
keep last stack, textbook mode, and clock type. These, and numerous
other flags, are accessible by pressing
(MODE).
Editing input forms is described in detail in chapter 2 of the User’s Guide.
System flags
Page 2-3
Flag commands
The flag commands are listed and explained in the table below. The flag
commands enable you to set and clear flags as well as having a value
returned that indicates the status of a specified flag: 1 if the flag is set, 0 if
the flag is clear.
Command
SF
CF
FS?
FC?
FS?C
!FC?C
Sets the specified flag.
Clears the specified flag.
Returns true (1) if the specified flag is set and false (0) if the
flag is clear.
Returns true (1) if the specified flag is clear and false (0) if the
flag is set.
Tests the specified flag, returns true (1) if it is set or false (0) if
it is clear, and then clears it.
Tests the specified flag, returns true (1) if it is clear or false (0)
if it is set, and then clears it.
Table 2-1 Flag commands
Description
User Flags
You can also apply the conunands listed in the table above to user flags.
(User flags are mainly used in programming.)
User flags are positive numbers, while system flags are negative numbers.
(In the System Flags list—discussed on page 2-1—the system flags are
shown as positive munbers. However, when you are setting, clearing, and
testing system flags, you must specify the flag as a negative number.)
You have access to 128 user flags. You can set, clear, and test them the
same way as with system flags. For example, to clear flag 25 that your
program has set, you issue the command CF(25).
Page 2-4
System flags
Chapter 3
Command line operations
The command line is where you enter and edit conunands and objects.
The HP 49G provides numerous tools to assist you when working on the
conunand line. Some of these tools have their own key; others can be
selected from the command line editor’s Tool menu.
Activating the command line
The way you activate the command line depends on whether you intend to
create a new object or edit an existing object.
To create a new object, just start typing. The command line is activated as
soon as you start. (While you can create most objects from the conunand
line, many objects are best created using specific applications. For
example, it will usually be easier to create an expression using Equation
Writer, or a matrix using Matrix Writer.)
To edit an existing object on the command line, select the object from
history or from the stack and:
® in algebraic mode, press (ENTER)
® in RPN mode, press EDIT.
Note that pressing EDIT in algebraic mode activates whatever application
is best suited to editing the type of object you selected, not the command
line editor. For example, if you selected an expression, pressing EDIT
activates Equation Writer. To edit the object on the command line, you
must press
Command Line operationsPage 3-1
Positioning the cursor
Wlien editing the object on the command line, you will almost always
need to reposition the cursor.
Main methods: single-line command line
Press @ or ® to move the cursor left or right respectively.
To go directly to the last chai'acter on the command line, press or
0
®.
To go directly to the first character on the command line, press 0® or
0
®.
Main methods: multi-line command line
In multiline entries—for example, blocks of progranmring code—press ®
or ® to move the cursor to the previous or next line respectively.
To go directly to the end of the last line, press 0®.
To go directly to position xin the last line, where xis the number of
characters the cmsor is from the start of the cuiTent line, press 0®.
To go directly to the start of the first line, press 0®.
To go directly to position x in the first line, where x is the number of
characters the cursor is from the start of the current line, press 0®.
Page 3-2
Command line operations
Helpful commands and sub-menus
Like all other HP 49G applications, the command line editor has its own
Tool menu. This menu is displayed by pressing
line is active (that is, while the cursor is blinking). You then select a
command by pressing the corresponding fmrction key.
The conunands that provide ways of positioning the cursor are:
(TOOp
while the command
-SKIP
SKIP^
^BEG
—^END
GOTO
Moves the cursor to the beginning of the current word
(that is, to the beginning of the word in which the cursor
is currently placed). If pressed again, the crnsor moves to
the beginning of the previous word if there is one.
Moves the cursor to the beginning of the next word (or to
the end of the word if there is no next word).
Moves the cursor to the begimiing of the selection or, if
nothing is selected, to the beginning of the command line.
(In multiline entries, the beginning of the command line is
the beginning of the first line of the entry.)
Moves the cursor to the end of the selection or, if nothing
is selected, to the beginning of the command line.
The GOTO menu provides three useful commands:
Go to line: this command sends the cursor to the start of
the line whose number you specify.
Go to position: this command sends the cinsor to the
position you specify (being the specified number of
characters—including spaces—from the start of the
command line).
See “Command line infonuation” on page 3-12 for
instructions on how to find tlie position of a character on
the command line.
Command line operations
Labels: this displays a list of labels in the object on the
command line. If you highlight a label in the list and press
OK or (ENTER). the cursor is sent to the start of that label.
A label is any string of characters that begins with an
asterisk. Labels are particularly useful in programming
code, where they can be used to name discrete blocks of
code.
Page 3-3
FINDThe Find command is on the Search sub-menu. You can
use this command to send the ciu'sor to the character or
character string you specify. See “Find” on page 3-8 for
more information.
Selecting characters
The HP 49G provides a number of commands that work on selected text
(such as copy and cut). To select characters, you mark the beginning of
the selection and the end of the selection.
1. Position the cursor at the beginning of your selection.
See “Positioning the cursor” on page 3-2 for a description of various
charactei’s to the left of the cursor to be selected. Therefore, if
you want to select all characters to the left of the cursor, press
at step 2 above and ignore the remaining steps
Copy, cut, and paste
1. Select the characters that you want to copy or cut.
This is explained on page 3-4 (and in chapter 3 of the User’s Guide if
you are selecting parts of an expression in the Equation Writer).
2. Do one of the following:
® to copy the characters, press
® to cut the characters, press
3. Position your cursor where you want to paste the characters you have
copied or cut.
See “Positioning the cursor” on page 3-2 for a description of ways to
position your cursor.
4. Press !
Page 3-4
or
Command line operations
Editing the command Line
Deleting characters
The simplest way to delete a character is to position the cm'sor to the
immediate right of the character and press @-
Other ways of deleting characters are provided by commands on the Tool
menu for the command line editor. The menu is displayed by pressing
when the command line is active. These commands are:
^DEL
0^DEL
DEL—y
0DEL^
DELL
REPLACE
Deletes the characters from the cursor to the beginning of
the current word (that is, to the beginning of the word in
which the cursor is currently placed). If pressed again,
the entire previous word is deleted if there is one.
Deletes all characters from the cursor to the start of the
line.
Deletes the characters from the cursor to the beginning of
the next word (or, if there is no next word, to the end of
the current word).
Deletes all characters from the cursor to the end of the
line.
Deletes all characters on the current line.
There are vaiious replace options on the Search menu.
These options enable you to search for the characters you
want to delete and replace them with nothing, thereby
deleting those characters.
The replace options are discussed on page 3-8.
Command line operations
Page 3-5
Inserting characters
By default, any character you enter on the command line will be inserted
between the characters on either side of the cursor. To replace characters
rather than insert them, you de-activate insert mode. Each character you
enter will then replace—that is, overwrite—the character directly below
the cursor.
To de-activate (or activate) insert mode:
1. With the conunand line active, press (TOOp.
fiSP KVZ HEK R= 'K'
tHPHEi
____
2. If the INS conunand is not displayed, press
imtil it is.
A small square to the right of the 4582.365
___________________
coimnand s label—as in the example on
tire right—indicates that insert mode is
active.
The shape of the cursor also indicates whether you are in replace
mode (ciffsor is a left-pointing arrow) or insert mode (cursor is a filled
rectangle).
Press INS to switch insert mode on off or on.
3.
Editing complex objects
In many cases you will find the methods outlined in the previous two
sections well-suited to editing command line objects. However, when you
need to edit a complex object, you might find it easier to isolate just that
part of the object you want to edit. To do this, make sure that the Tool
menu for the conurrand line editor is displayed. (Press (TOOp if it is not.)
1. Select tire part of the object that you want to edit.
See “Selecting characters” on page 3-4 for instructions.
2. If the EDIT command is not displayed, press (MD imtil it is.
3. Press EDIT.
Your selection now appears on tire command line by itself The rest of
the object has not been deleted; it is just not visible while you edit yoiu'
selection.
4. Edit the entry on the coirurrand line.
5.
Press
(ENTER).
The object you started with is redisplayed, showing the changes you
made at step 4 above.
Page 3-6
Command line operations
Evaluating components oF the command line
If there is a component of your object that could be evaluated—such as a
mathematical expression—^you can select the component and evaluate it.
The result of tlie evaluation replaces the component.
To evaluate a component, make sure that the Tool menu for the command
line editor is displayed. (Press (TOOp if it is not.)
1. Select the component of the object that you want to evaluate.
See “Selecting characters” on page 3-4 for instructions.
2. If
the
EXEC
command is not displayed, press (NXT) until it is.
3. Press EXEC.
The component is evaluated, if possible, and the result replaces the
component.
Suspending editing
You can suspend editing the command line and return to it later,
performing other operations in the meantime. To do this, make sure that
the Tool menu is displayed. (Press (TOOD if it is not.)
1. If the HALT command is not displayed, press (RED until it is.
2. Press HALT.
Your default screen is redisplayed. You can now use the calculator to
perform other operations.
While you have an editing session suspended, the annunciator HLT
appears in the status area of yoiu' default screen (providing that you
have not hidden the status area).
3. Press 0 {®® to return to the conunand line you earlier suspended.
You will notice that the contents of the command line have not been
affected by the operations you perfoimed since suspending editing.
While you have one command line editing session suspended,
you can suspend another. In fact, you can suspend any iiuiiiber of
command line editing sessions.
Mien you have more than one editing session suspended,
pressing HCoRrj returns you to the most recently suspended
session. Pressing (0(@) again returns you to the second most
recently suspended session, and so on.
Command line operations
Page 3-7
Find and replace
Tlie HP 49G provides a number of search aird replace commands to help
you edit multiline objects (such as arrays and programs). These are
available from the Search menu (which is a sub-menu of the Tool menu).
1. With an object on the command line, press (TOOD.
2. Press (HxT) to display the second page of the Tool menu.
3. Press SEARCH.
A choose list appears listing the find and
replace options.
Find
RAD
ÎH0H
2. Rep lace..
S.Find next
H.Rep lace Selection
S.Replace-^Find Rext
e. Rep lace All
F.Fast Replace All
45£
This conrmand searches througli the object
on the coinmand line and highlights the first instance of a character or
character string that matches yom search string (that is, the character or
character string you specify).
The Find command begins searching from the position of the
cursor. Therefore, if your cursor is not at the start of the object,
there is a risk that the Find conmiaiid will not find your search
string even though tlrat string is in the object. It is important, then,
that you position the cursor at the start of the object if you want
to find all occurrences of your search string..
If necessary, position the cursor at the beginning of the object on the
1.
command line.
Display the Search menu, make sure that option 1—Find-
2.
-IS
highlighted and press OK or (ENTER).
The Find input fonn is displayed.
Enter the character or character string
3.
that you want to find.
The characters you type appear near the
bottom of the input form.
Search For:
¿¡Case Scri5itiuc
Eriter search pattern
GMii
IHTrïïglBEM
Press OK or dUD to place the characters you have typed into the
Search For field.
The cursor is now positioned in the Case Sensitive field. By default, the
Find command performs a case sensitive search; that is, an upper-case
character is considered a different character to its lower-case
companion.
Page 3-8
Command line operations
5. If you do not want a case sensitive search, press CHK.
The tick in the Case Sensitive field is deleted. Your search will now
look for both the upper-case and lower-case versions of the characters
you entered into the Search For field.
6.
Press OK or
(ENTER)
to begin the search.
If your search string is found, it will be highlighted on the command
line; otherwise a message is displayed infonning you that your search
string cannot be foimd.
Note that the Find command will look for your search string as both a
whole word and as part of a longer word. For example, a search for A*B
would be satisfied by the string D/A*B+2. You camrot set the HP 49G to
perform only whole-word searches.
Find next
The object you are searching for might contain more than one instance of
your search string. To find the next instance:
1. Display the Search menu.
2. Type 3 (or press (vj imtil FIND NEXT is highlighted).
3.
Press OK or
If your search string is found, it is highlighted on the command line;
otherwise a message is displayed infonning you that no further
instances of your search string can be found.
(ENTER).
Note that the HP 49G does not continue searching from the beginning of
the object once it has reached the end.
Command line operations
Page 3-9
Replace
The Replace command searches through the object on the command line
and highlights the first instance of a character or character string that
matches your search string (that is, the character or character string you
specify). You can then replace that string with another string.
The Replace command begins searching from the position of the cursor.
Therefore, if your cursor is not at the start of the object, there is a risk that
the Replace command will not find your search string even though that
string is in the object. It is important, then, that you position the cursor at
the start of the object if you want to find all occurrences of your search
string.
1. If necessary, position the cursor at the beginning of the object on the
command line.
2.
Display the Search menu.
Type 2 (or press ® until REPLACE., is highlighted).
3.
4.
Press OK or (ENTER).
The Find Replace input fonu is displayed.
Enter the character or character string
5.
that you want to replace.
The characters you type appear near the
Sidcch for-
ftCpUCi by:
Entgr ggorch pott-grn
REf-LSCES
_________
bottom of the input form.
Press OK or (EWER) to place the characters you have typed into the
6.
Search For field.
Enter the character or character string that you want to substitute for
the search string.
The characters you type appear near the bottom of the input form.
Press OK or (ENTER) to place the characters you have typed into the
Replace By field.
The cursor is now positioned in the Case Sensitive field. By default, the
Replace conuuand performs a case sensitive search; that is, an upper
case character is considered a different character to its lower-case
companion.
If you do not want a case sensitive search, press CHK.
9.
The tick in the Case Sensitive field is deleted. Your search will now
look for both the upper-case and lower-case versions of the characters
you entered into the Search For field.
Page 3-10
Command line operations
10. Press OK or (ENTER) to begin the search.
If your search string is found, it will be highlighted on the command
line; othei-wise a message is displayed informing you that your search
string cannot be formd.
11. If you don’t want to replace the current selection but want to continue
looking for your search string, select FIND NEXT from the Search menu
and repeat this procedure from step 10.
If you want to replace the current selection with the specified
substitute term, you have four options to choose from:
• replace the current selection (option 4 on the Search menu)
® replace the current selection and find the next mstance of the
search string (option 5 on the Search menu)
» replace the current selection and all other instances of the search
string, moving the cursor from instance to instance in the process
(option 6 on the Search menu)
• replace the current selection and all other instances of the search
string without moving the cursor from instance to instance (option
7 on the Search menu). At the end of this replace operation, the
cursor is positioned at the place of the last change.
Option 7—Fast replace—is significantly faster if the object yoiu are
searching for extends over many lines (as in the case of a large
program).
12. Display the Search menu and choose the replace option you want.
13. Press OK or (ENTER) to begin the replace operation.
Command Line operations
Page 3-11
Command Line information
The command line editor Tool menu also
provides general infonnation about the
object on the command line and the position
of the cursor. To see this infonnation, press
■Co HHo nd Lin e
Km%mm
i t iri ii :
KpO Sit io n:s Sth Si 2«:L1
VpO fit io n:
Pos iti on :
Lin e 5 i2 C:
7
Text Sx2i-la
7
Hen m'j ■aHD
13 Cl ip
Si2 i:0
H
Set. Ji2 i:
INFO. A screen entitled “Connnand Line”
appears.
The fields on this screen are:
# Lines The nimiber of lines over which the object extends.
X position The niunber of characters from the start of the line to the
position of the cursor.
Y position The number of the line in which the cmsor is placed.
Position The number of the characters from the start of the object
to the position of the cursor.
line Size The number of characters in the line on which the cursor
is placed.
Text Size The number of characters in the object.
Stk Size The number of objects in history (or on the stack).
Mem (KB) The amount of free memory.
Clip Size The munber of characters on the clipboard (that is, the
number of characters you last copied or cut).
0
Sel. Size The number of characters in the current selection.
Page 3-12
Command line operations
Styles
You can set the style of a command line entry to bold, italic, underlined, or
inverted, or to any combination of these characteristics. You can also
choose a different font for the entiy. To do this, make sure that the
command line is active and the Tool menu for the conunand line editor is
displayed. (Press
1. If the STYLES command is not displayed, press (NXD luitil it is.
2. Press the fimction key that corresponds to the style you want the
command line to have:
® (0) for BOLD
® (£2) for ITALIC
® (£3) for UNDERLINED
® (ED for INVERTED
® (ED to display the fonts list from which you can choose a different
font.
Press d
editor.
Note that styles are retained when the object appears on history or on the
stack only if that object is a string (that is, enclosed within inverted
commas).
(TOOp
if it is not.)
for EDIT to return to the Tool menu for the command line
Command line operations
Page 3-13
Chapter 4
The Stack
The HP 49G keeps a record of the objects you enter and the results of your
operations. In algebraic mode this record is called history; in RPN mode it
is called the stack.
Using the stack
Entries on the stack are niunbered (as in the
example at tire riglrt). Air entry on the stack is
referred to as being on a particular level. The
level is the number of the line on which the
entiy appears. In the example at the right, 58
RMi KVZ HEK R= 'K'
■ CHOHE?
isiaBniiSiaBi
__________
93.514704726
58
___
■J8745
6
is on level 4, 6 is on level 3, is on level
2, and so on.
If you are working in RPN mode, you will use the stack to perfonn
calculations. In doing so, you need to be aware of differences between the
way calculations are performed and displayed in RPN mode and in
algebraic mode, hr RPN mode:
® A command that requires arguments—that is, a command that needs
objects to act on—takes its arguments from the stack. Therefore, the
arguments must be present before you execute the command: one
argument per level and in the correct order. (There is one exception:
when the command takes only one argument, you can execute the
command with the argument on tire command line, not on the stack.)
• A command’s arguments are removed from the stack when the
command is executed. The argmrrents are replaced by the result of the
calculation.
In contrast, in algebraic mode you specify your arguments after you enter
the commaird, and the command and its arguments are retained in history
together with the result of the calculation.
For example, to find the cube of 52, you need to specify two arguments:
the nimrber (52) and the index (3). In algebraic mode, you enter:
52 (>^j3 (ENTER)
The Stack
Page 4-1
In RPN mode, you enter:
In other words, in RPN mode 52 and 3 are
entered onto the stack before the conunand
U
____________ _____________
-Jd
3
is entered; 52 must be on level 2 and 3 on
level 1 before the command is executed.
Strictly speaking, the last (or only) argument does not need to be on the
stack before you execute a command in RPN mode. You can execute a
command with the last (or only) argument still on the command line.
Therefore, the second (BW) in the example immediately above can be
omitted. However, any argument still on the command line when a
command is executed will not be displayed on the stack if you undo the
command (which you can do by pressing R(DND0)). Therefore, if you think
you may need to imdo a command and be able to see all the arguments,
you should put all the arguments onto the stack before executing the
command.
Example stack calculations
Using a one-argument command
1. If the argument is not already on level 1 of the stack, enter the
argument onto the conunand line (and, optionally, onto the stack). If
the argument is already on level 1 of the stack, go straight to step 2.
2. Execute the command.
Example: To calculate
1
sin 30
1. Enter 30 and press
2. Press (sin).
The result of sin 30 is now on level 1 of the stack. This result can be
used as the argument of a further command without the result needing
to be manually entered.
3. Press (3-
Note that if you get a symbolic answer when you wanted a niunerical
answer, press 0@yM). The symbolic answer is evaluated.
Page 4-2
The Stack
Using a multi-argument command
Method 1
1. Enter the arguments, pressing (ENTER) after each one.
2. Execute the command.
Example: To calculate 23 x 97
1. Enter 23 and press (0
2. Enter 97 and press (B
23 is now on level 2 of the stack and 97 is
on level 1.
3. Press @.
In this example, the order in which you enter the arguments does not
affect the answer. However, this is not always the case with two-argument
conunands. In the cube example on page 4-2, the result of entering the 3
before the 52 is the 3 raised to the power of 52, a very different result to 52
raised to the power of 3. Other examples where the order you enter the
arguments is important include subtraction, division, and the percentage
commands (%, %CH, and %T).
2! 23
l: 97
Method 2
In method 1 above, each argument is entered onto its own level of the
stack before the conuxiand is executed. Another way is to enter all the
elements onto the command line separating each with a space. Either:
• press (ENTER) to place the arguments onto the stack and then execute
your command or
• execute your command with the arguments still on the command line.
Example: To calculate "1/531441
1. Enter 531441 (SPC) 3
2. Press (EH).
3. Press 0(Vr).
Step 2 can be oiuitted if you will not want to imdo the command and see
Because the result of a calculation is retained on the stack, you can easily
perform complex calculations by accumulating the results of sub
calculations on the stack and then treating these results as the arguments
m a fmther calculation.
Example: To calculate 13^ - (17 x 19) + |
1. Enter 1300.
The result—169—appears on level 1 of the stack.
2. Enter 17 and press (ENTER).
3. Enter 19 and press (ENT0.
4. Press ®.
The product of 17 and 19—323—appears on level 1, and the previous
result—169—is now level 2.
5. Press
Q.
The two previous results—169—and 323—are now treated as the
arguments in a fmther operation. This operation replaces the
arguments with the result of the operation, that is, the difference
between the fust result and the second.
Page 4-4
The Stack
Chapter 5
Matrices and linear algebra
The HP 49G has extensive capabilities for entering and manipulating
anrays. An array object can be a vector or matrix.
Many of the matrix operations described in this chapter also apply to
vectors. Wherever this is the case, the more general term array is used
instead of m ati'ix.
By default, Matrix Writer will interpret a one-row array as a vector rather
than as a matrix. If you want a one-row array interpreted as an array, press
VEC first.
For instructions on how to create an ainay—and how to open an array in
Matrix Writer—see chapter 8 of the User’s Guide.
Matrix Writer operations
The following summarizes the operations that are available in Matrix
Writer.
To move around an array
Method 1: using arrow keys
Press the aiTow keys to move the cursor from cell to cell.
You can press 0 before an arrow key to move the cursor directly to an
The Matrix Writer input form is displayed.
Note that the GOTO command is on the second page of the Matrix
Writer menu, so you may need to press (NXT) to display it.
2. Enter the row number of the cell you want to go to.
3.
Press
4.
Enter the cohmm number of the cell you want to go to.
5.
Press
6.
Press
(ENTER).
(EiiER).
OK
or
(ENTER).
The matrix is redisplayed and the cursor is now in the cell whose rowcolumn coordinates you specified.
To edit an array
1. Move the cursor to a cell to be edited.
See the previous section for instructions on cursor movement.
2.
Press EDIT.
The contents of the cell are copied to the conunand line.
If you want to completely change the contents of the cell, you can
do so without first pressing
contents. Wliat you type appears on the conunand line.
EDIT.
Just start typing the new
3. Make your changes.
4.
Press
(ENTER)
to move yoiu changes from the command line to the cell.
5. Repeat from step 1 if you want to change other cells.
6.
Press
(ENTER)
to close Matrix Writer and place the changed array on the
command line (or press {CANffl) to close Matrix Writer and discard your
changes).
If you discarded your changes, ignore the next step.
7. Press (ENTER) again to save your changes.
Page 5-2
Matrices and linear algebra
To make the cells narrower or wider
• Press ^WID to make the cells nan"ower.
More columirs ai'e displayed.
® Press WID-^ to make the cells wider.
Fewer colmrms are displayed.
Note that these commands modify the width of all columns, not just the
column with the highlighted cell.
To control how the cursor moves aFter an entry
By default, the cursor moves to the adjacent cell in the next column after
you place an object in a cell. You can change this setting in one of two
ways:
• To make the cursor move to the adjacent cell in the next row after
entry, press Goi.
A small box (■ ) appears beside the command on the menu.
• To prevent the cursor from advancing at all after entry, press GO^ and
Goi until neither command shows a box (■ ) beside it on the menu.
The setting you choose remains the mode of cursor movement mitil you
change the setting again.
To return to the default setting, press GO^ rmtil a box (■ ) appears beside
it on the menu.
If you want to change the way the cursor moves through an array, make
your change before entering objects into the array. Once you start entering
objects, the way the cursor moves cannot be changed.
Matrices and linear algebra
Page 5-3
Manipulating columns and rows
To insert a column
1. Move the cursor to the column where you wairt the new coliuun to
appear.
2. Press +COL. A coliurm of zeros is inserted.
Note that the +COL command is on the second page of the menu, so
you may need to press (NXT) to display it.
You can also add a column to an an’ay without using Matrix Writer.
See “To insert one or more new columns into an array” on page 5-
11.
To add a column to the right oF the last column of data
Move the cursor to the last cell in the group of cells you want to delete.
4. Press 0 (END) to select END.
(BEGiN)
to select BEGIN.
The cells between your beginning and end cell are now highlighted.
5. Press DEL to delete the contents of the highlighted cells.
The DEL conunand does not leave the selected cells empty. Instead, the
contents of a cell are replaced with a zero.
Matrices and linear algebra
Page 5-5
Summary oF Matrix Writer operations
KeyDescription
EDIT
VEC
^WID
WID^
GO-»
GOi
+ROW
-ROW
+COL
-COL
-^STK
Places the contents of the ciuTent cell on the command line
for editing.
For one-row arrays, toggles between vector entry and matrix
entry. If this command is selected, one-row arrays are
entered onto the command line as vectors (example:
[ 1 2 3 ]); if it’s not selected, one-row arrays are entered as
matrices (example: [[123 ]]).
Decreases the width of all cells.
Increases the width of all cells.
Sets left-to-right entry mode. The cursor moves to the next
column after data entry.
Sets top-to-bottom entry mode. The cursor moves to the
next ro w after data entry.
Inserts a row of zeros at the current cursor position.
Deletes the current row.
Inserts a column of zeros at the ciuTent cursor position.
Deletes the current colionn.
Copies the current cell to history (level 1 of the stack).
Page 5-6
GOTO
DEL
Move the cursor to a specified cell.
Replace the contents of selected cells with zeros.
Matrices and linear algebra
Advanced matrix operations
Creating special matrices
To create an array Riled with a given constant
1. Select the Constant Array command.
0 (WTRICESl CREATE CON
2. For the first argument of the command, enter either:
• a list containing the dimensions of the desired constant array:
{ roivs, cohmins } or
• an existing array.
.3. For the second argument, enter the constant that you want in the array.
4. Press®®).
The result is an array of the dimensions you entered (or of the
dimensions of the specified array) filled with the specified constant.
To create an identity matrix
1. Select the Identity Matrix command.
CREATEIDN
2. Enter either:
• a number representing the number of rows and columns you want
in the identity matrix or
• an existing array.
3. Press®®).
The result is an identity matrix of the specified dimensions (that is, a
square matrix with zero for all elements except the diagonal elements,
which are all 1).
Matrices and linear algebra
Page 5-7
To create an array filled with random integers
1. Select tlie Random Matrix comnaaird.
0 {Bm CREATE RANM
2. Enter either:
• a list containing the dimensions of the desired random matrix:
{ rows, columns } or
® an existing array.
3.
Press
(ENTER).
The result is a random aiTay of the specified dimensions (or of the
dimensions of the specified array). The elements are integers within
the range -9 to 9.
Assembling matrices
To assemble a matrix by rows From a series of vectors
1. Select the Rows-to-Matrix command.
0 @1® CREATE ROW ROW^
2. Enter each vector in the order you want them to appear in the matrix.
Enter the row 1 vector first, then the row 2 vector, and so on,
separating each vector with a comma.
3.
Enter the niunber of rows in the desired matrix.
4. Press (ENTE^.
The result is a matrix composed of the vectors you entered.
To assemble a matrix by columns From a series of vectors
1. Select the Columns-to-Matrix command.
0 fMATRiCEgl CREATE COLUMN COL^
2. Enter each vector in the order you want them to appear in the matrix.
Enter the column 1 vector first, then the colunui 2 vector, and so on,
separating each vector with a comma.
3.
Enter the nmnber of colunms in the desired matrix.
4. Press®®.
The result is a matrix composed of the vectors you entered.
Page 5-8Matrices and linear algebra
To assemble a matrix with a particular diagonal From a vector
1. Select the Vector-to-Matrix Diagonal conmiand.
0 {MS§) creatediag^
2. Enter the vector containing the diagonal elements.
3. Enter either:
• a list containing the dimensions of the desired matrix: {nrwscolumns] or
• a real number representing the number of rows and columns in the
desired square matrix.
4. Press (HI).
The result is a matrix of the desired dimensions using the elements of
the vector as the diagonal elements of the matrix. If the vector
contains more diagonal elements than are needed to create the matrix,
the extra elements are discarded. If the vector does not contain
enough elements to complete the matrix, the imdefined diagonal
elements are set to zero.
To assemble a matrix From a sequence oF elements
1. Select the Stack-to-Array conunand.
0 (PRG) TYPE ^ARRY
2. Enter the elements in rote-major order.
Row-major order begins with the first element (the element in row 1
and column 1). The next element is the next one in the row. If there are
no more elements in the row, the next element is the first element in
the next row, and so on.
3. Enter a list containing the dimensions of the desired matrix: {rows,
columns].
4. Press (H5) to assemble the matrix.
For example, ^ARRY(1, 2, 3, 4, ¡2, 2j) results in
^1 2
3 4
Matrices and linear algebra
Page 5-9
Disassembling matrices
To disassemble a matrix into its elements
1. Select the Object-to-Stack conomand.
0 (PRG) TYPE OBJ->
2. Enter or select the matrix you want to disassemble.
3. Press (EB.
The matrix is disassembled in row-major order. A list indicating the
dimensions of the matrix is also returned.
To disassemble a matrix into row vectors
1. Select the Matrix-to-Rows command.
0 CREATE ROW ^ROW
2. Enter or select the matrix you want to disassemble.
3.
Press
(ENTER).
The result is a list of row vectors (first row to last), and the number of
rows in the matrix.
To disassemble a matrix into column vectors
1. Select the Matrix-to-Columns command.
0
(BiCES)
CREATE COLUMN ^COL
2. Enter or select the matrix you want to disassemble.
3. Press (ENTER).
The result is a list of column vectors (first column to last), and the
number of columns in the matrix.
To extract the vector oF diagonals From a matrix
1. Select the Matrix-Diagonal-to-Ari'ay conunand.
0
(BWCES)
CREATE -»DIAG
2. Enter or select the matrix.
3.
Press
Page 5-10
(EN
The result is a vector whose elements were the diagonal elements of
the matrix.
Matrices and linear algebra
Inserting rows and columns
To insert one or more new rows into a matrix
1. Select the Insert Row command.
0 (MATRICES)
CRBTATE ROW ROW+
2. Enter or select the ari’ay you want to modify.
3. Enter the vector or matrix that you want to insert.
An inserted array must have the same number of cohunns as the array
into which it is being inserted.
4. Enter the row number you want the first (or only) inserted row to be.
5.
Press
(ENTER).
The rows beneath, and including, the row specified at step 4 are
pushed down to make room for the inserted rows.
You can also add rows to an array using Matrix Writer. See “To
insert a row” on page 5-4.
To insert one or more new columns into an array
1. Select the Insert: Colunm command.
0 (WCB) CREATE COLUMN COL+
2. Enter or select the array you want to modify.
3. Enter the vector or matrix that you want to insert.
An inserted array must have the same nimrber of rows as the array into
which it is being inserted.
4. Enter the column number you want the first (or only) inserted colmnn
to be.
5. Press :
6. The columns to the right of, and including, the column specified at step
4 are pushed to the right to make room for the inserted columns.
You can also add columns to an array using Matrix Writer. See “To
insert a column” on page 5-4.
Matrices and linear algebra
Page 5-11
Extracting rows and columns
To extract a particular row From an array
1. Select the Delete Row command.
0 (illCES)
CREATE ROW ROW-
2. Enter or select the array with the row you want to extract.
3. Enter the number of the row you want to extract.
4. Press
The result is the array without tlie extracted row, and the extracted
row as a vector.
To extract a particular column From an array
1. Select the Delete Coluimr conuuand.
0
(MATRICES)
2. Enter or select the matrix with the cohmin you want to extract.
3. Enter the number of the column you want to extract.
4.
Press
The result is the matrix Avithout the extracted colunm, and the
extracted column as a vector.
Swapping rows and columns
CREATE COLUMN COL-
(ENTER).
To swap two rows in an array
1. Select the Row Swap command.
0 (Beg) CREATE ROW RSWP
2. Enter or select the aiTay with the rows you want to swap.
3. Enter the number of the one of the rows you want to swap.
4. Enter the number of the other row you want to swap.
5.
Press
Page 5-12
(ENTER).
The result is the array with the two specified rows swapped.
Matrices and linear algebra
To swap two columns in an array
1. Select the Colmim Swap command,
0 (MfiCB) CREATE COLUMN CSWP
2. Entei" or select the matrix with the coluimis you want to swap.
3. Enter the number of the one of the columns you want to swap.
4.
Enter the number of the other column you want to swap.
5. Press (ENTER).
The result is the array with the two specified columns swapped.
Extracting and replacing elements oF matrices
To extract the element at a specified position
1. Select the Get Element command.
0 (WSS) CREATE GET
2. Enter or select the array with the element you want to extract.
3. Enter either:
• a list containing the row number and column number of the
element you want to extract, or
• the position number—that is, row-major number—of the element
you want to extract.
4. Press (ENTER).
The result is the extracted element.
To replace an element at a specified position
1. Select the Put Element command.
CREATE PUT
2. Enter or select the array with tlie element you want to replace.
3. Enter either:
• a list containing the row number and column number of the
element you want to replace, or
• the position number—that is, row-major number—of the element
you want to replace.
4.
Press
Matrices and linear algebra
(ENTER).
The result is a modified array.
Page 5-13
Characterizing matrices
Matrix calculations are often sensitive to special characteristics of the
matrices used. The HP 49G has a number of commands that return
characteristics of matrices. Note that some commands are only defined
for square matrices, some for any rectangular matrix.
Commands For characterizing matrices
Keys
R (MATRICES) OPERATIONS SIZE
R (WiCB) OPERATIONS ABS
0 (MAil0 OPERATIONS SNRM
R (MATRICES) OPERATIONS RNRM
R (MATRICES) OPERATIONS CNRM
Description
Returns the dimensions of the array
(that is, the niunber of rows and
number of colimms).
Returns the Frobenius norm of a matrix
and the Euclidean length of a vector:
the square root of the sums of the
squares of the absolute values of the
elements.
Returns the spectral nonn of a matrix.
The spectral nonn of a matrix is equal
to the largest singular value of the
matrix. Same as ABS for a vector.
Returns the row norm of a matrix. The
row nonn of a matrix is the maximum
value (over all rows) of the siuns of the
absolute values of all elements in a row.
The row norm of a vector is the
maximiun absolute value of its
elements.
Returns the colunm nonn of a matrix.
The colunm nonn of a matrix is the
maximum value (over all columns) of
the suiTO of the absolute values of all
elements in a column. The colunm
nonn of a vector is the sum of the
absolute values of its elements.
Page 5-14
Matrices and linear algebra
Keys (Continued)
Description
R (iWRICES) OPERATIONS SRADReturns the spectral radius of a square
matrix. The spectral radius is the
absolute value of the largest eigenvalue
of the matrix.
R (MATRICES) OPERATIONS OONDRetimis the cohmm-norm condition
number of a square matrix. The
condition number is defined to be the
product of the column norm of a square
matrix and the colunui norm of its
inverse.
0 (MATRICES) OPERATIONS RANK
0 CMATRICES) OPERATIONS DET
0 (MATRICES) OPERATIONS TRACE
Returns an estimate of the rank of a
matrix. The rank of a matrix is equal to
the luunber of non-zero singular values
of the matrix. If flag -54 is clear
(default), RANK treats any computed
singular value less than 10“^'* times the
size of the largest computed singular
value as zero. If flag -54 is set, RANK
comits all non-zero singular values no
matter what their size.
Returns the determinant of a square
matrix. DET checks flag -54, and will
refine its computed value only if -54 is
clear (default).
Returns the trace of a square matrix.
The trace of a matrix is equal to the
smn of the diagonal elements and also
equal to the sum of the eigenvalues of
the matrix.
Matrices and linear algebra
Page 5-15
TransForming matrices
To transpose a matrix
1. Select the appropriate Transpose Matrix command:
® 0
EH)
MATRIX MAKE TEN (if you want the conjugate transpose of a
complex matrix), or
® 0 (WiCB] OPERATIONS TRAN (if you want transposition without
conjugation).
2.
Enter or select the array you want to transpose.
3.
Press
(ENTER)
to transpose the matrix.
The first row of the original matrix is now the first column, the original
second row is now the second colmnn and so on.
To invert a square matrix
1. Press 0.
2.
Enter or select the array you want to invert.
3.
Press
(ENTER)
to transpose the matrix.
To change the dimensions of an array
1. Select the Redimension Array command.
0 (BCES) CREATE RDM
2.
Enter or select the array that you want to redimension.
3.
Enter a list containing tire new dimensions of the aixay:
{ roiv, colum n }.
4.
Press
(ENTER).
Elements from the original array are placed in row-major order into
the newly-dimensioned array. If there are fewer elements in the new
array than in the original one, the excess elements are dropped. If
there are more elements in the new array tlran in tire original one, the
missing elements are filled with zeros (or (0,0) if the array is complex).
For example, rdm(
Page 5-16
1 2
, {3,4 j) results in:
_3 4
12 3 4
0 0 0 0
0 0 0 0
Matrices and linear algebra
More matrix arithmetic
Simple matrix arithmetic is covered in chapter 8 of the HP 49G User’s
Guide. This section covers some of the other aritlimetic options.
3. Enter the square matrix.
The number of rows in the matrix must equal the number of rows in
the array.
4. Press (EN
Matrices and linear algebra
Page 5-17
TransForming complex matrices
To combine two real matrices into a complex matrix
1. Select the Real-to-Complex command.
0 (M® COMPLEX R^C
2. Enter or select the real matrix that will become the real part of the
complex matrix.
3. Enter or select the real matrix that will become the imaginary part of
the complex matrix.
This matrix must have the same dimensions as the matrix entered at
step 2.
4. Press (ITER).
The two real matrices are combined to form a complex matrix.
To split a complex matrix into two real matrices
1. Select tire Complex-to-Real conmrand.
0 (MTH) COMPLEX C^R
2. Enter or select the complex matrix that you want to split.
3.
Press
(ENTER).
The result is two real matrices formed from the complex matrix.
To conjugate each element of a complex matrix
1. Select the Conjugate function.
0 COMPLEX CONJ
2. Enter or select the complex matrix that you want to conjugate.
3. Press
To extract the matrix of real parts from a complex matrix
1. Select the Real Part function.
0 COMPLEX RE
2. Enter or select the complex matrix whose real components you want
to extract.
3.
Press
Page 5-18
(ENTER).
The result is a matrix comprising just the real components of the
complex matrix.
Matrices and linear algebra
To extract the matrix of imaginary parts From a complex matrix
1. Select the Imaginary Part function.
0 COMPLEX IM
2. Enter or select the complex matrix whose imaginary components you
want to extract.
3. Press
The result is a matrix comprising just the imaginary components of the
complex matrix.
Linear algebra topics
The use of matrix functions to solve systems of linear equations is
covered in chapter 8 of the HP 49G User’s Guide. This section covers
other important linear algebra commands.
Eigenvalues and eigenvectors
A square (n x ?z) matrix A is said to have an eigenvalue X and a
corresponding eigenvector x if Ax = ?tx.
Eigenvalues are the roots of the characteristic equation—det(A - H) =
0—which is a polpromial of degree n. Thus, A has n eigenvalues, although
they are not always distinct. Each eigenvalue has a corresponding
eigenvector.
The HP 49G allows you to compute either the eigenvalues only (a faster
computation) or both the eigenvalues and their corresponding
eigenvectors.
To compute the eigenvalues For a square matrix
1. Select the Eigenvalues command.
EIGENVECTOR EGVL
2. Enter or select the square (n x n) matrix whose eigenvalues you want
to calculate.
3. Press
The result is a vector of n eigenvalues.
Matrices and linear algebra
Page 5-19
To compute the eigenvalues and eigenvectors For a square
matrix
1. Select the Eigenvalues and Eigenvectors command.
0 (iliCES) EIGENVECTOR EGV
2. Enter or select the square (w. x n) matrix whose eigenvalues and
eigenvectors you want to calculate.
3. Press (ENTER).
The result is an n x n matrix of eigenvectors and an »-element vector
of eigenvalues.
To compute the singular values oF a matrix
1. Select the Singular Values command.
0 SID
FACTORIZATION SVL
2. Enter or select the matrix.
3. Press (H).
The result is a vector—of length MIN(7»,ii)—of the singular values of
the matrix. The values are returned in non-increasing order.
Page 5-20
Matrices and linear algebra
To decompose or factor a matrix
The HP 49G offers a set of matrix decomposition and factorization tools
that you can use either alone or in program routines to solve specialized
problems. These tools are explained in the following table:
Keys
H (MATRICES) FACTORIZATION LU
R (MATRICES) FACTORIZATION LO
(^] (MATRICES) FACTORIZATION OR
Description
Grout LU Decomposition. This
procedure is used in the process of
solving an exactly-determined system
of linear equations, inverting a matrix,
and computing the determinant of a
square matrix. It factors the square
matrix (A) into a lower-triangular
matrix L, an upper-triangular matrix U
containing ones on its diagonal, and a
permutation matrix P such that
PA = LU.
LQ Factorization. This command
factors an mx n matrix A into an m x n
lower trapezoidal matrix L, an nx n
orthogonal matrix Q, and an mx m
permutation matrix P such that
PA = LQ.
QR Factorization. This command
factors an mx n matrix A into an mx
m orthogonal matrix Q, an mx n upper
trapezoidal matrix R, and an nx n
permutation matrix P such that
AP = QR.
R (i\ilCB) FACTORIZATION
SCHIIR
Matrices and linear algebra
Schur Decomposition. This
command factors a square matrix A
into an orthogonal matrix Q and an
upper-triangular matrix (or, if A is real
valued, the upper quasi-triangular
matrix) U such that A = QUQ^ (where
Q^ is the transpose of matrix Q).
Page 5-21
Keys (Continued)
Description
R (MATRICES) FACTORIZATION SVD
Singular Value Decomposition. This
command factors an m x n matrix A
into an mX m orthogonal matrix U, an
nX n orthogonal matrix V, and a vector
S of the singular values of A such that
A = US‘V (where S‘ is the mx n matrix
fomied by using the elements of S as its
diagonal elements).
Page 5-22
Matrices and Linear algebra
Chapter 6
Unit objects
The Units application contains a catalog of 127 imits that you can combine
with real numbers to create unit objects. It also provides you with tools to
manipulate unit objects.
The Units application enables you to:
• convert imits—for example, you can convert the imit object 10_ft to
120Jn or 3.048„m
• factor imits—for example, you can factor 20_W with respect to 1__N
and return 20_N*m/s
• calculate with units—for example, you can add 10_ft/s to 10_mph and
return 16.82_mph.
Overview of the Units application
The calculator’s units are based on tire 7 base units of the International
System of Units (SI): m (meter), kg (kilogram), s (second), A (ampere), K
(kelvin), cd (candela), and mol (mole). The HP 49G makes use of two
additional base units: r (radian) and sr (steradian). The remaining 118
units are compoimd imits, that is, imits derived from the 9 base imits.
For example, in (inch) is defined as .0254m, and Fdy (Faraday) is defined
as 96487 A*s. (See appendix B of the User’s Guide for a complete listing of
the built-in imits and their SI values.)
Units are grouped into the following categories:
lengtharea
speedmassforceenergy
powerpressure
anglelightradiumviscosity
volumetime
temperatureelectric current
These categories can be chosen from the Units menu (displayed by
pressing (r
Unit objects
Page 6-1
Unit objects
A unit object has two parts: a real number and a unit expression (a single
unit or multiplicative combination of imits). The two parts are linked by
the imderscore character For example, 2_in (2 inches) and 8.303_gal/Ii
(8.303 US gallons per hour) are imit objects. Like other object types, a unit
object can be placed on the stack, stored in a variable, and used in
algebraic expressions and programs.
Wlien you perform a unit conversion, the HP 49G replaces the old unit
expression with the new unit expression you specify, and automatically
multiplies the number by the appropriate conversion factor.
Operators in unit objects follow this order of precedence:
1. ( )
2. ^
3. *and/
For example, 7_m/s^2 is 7 meters per second squared, and 7__(mys)^2 is 7
square meters per second squared.
To create a unit object
1. Key in the number part of the unit object.
2. Press 0 Q.
3. Press 0 (iJNifS) to display the Units menu.
4. Press @ or @ imtil the category of the unit is highlighted.
5.
Press OK or
6. Press (0 or ® imtil the imit is higlilighted.
7.
Press OK or
8. For compoimd imits, repeat from steps 3 for each additional miit in the
unit expression, preceding each with ®, 0, or (0 as required.
(ENTER).
(ENTER).
If you Imow the imit abbreviation, you can type it directly on the
conmiiBid line instead of selecting it from the Units menu. Note
that unit names are case-sensitive; for example, Hz (hertz) must be
typed witii an uppercase H and a lowercase z.
In addition to the method outlined above, you can create a imit object in
RPN mode by assembling it from components on the stack.
Page 6-2Unit objects
To assemble a unit object from the stack
1. Place the number part of the unit object on level 2 of the stack and the
mrit expression on level 1.
The imit expression must be in the format n_unit where n is any real
number and unit is the unit abbreviation (lb, in, m, etc.)-
2. Execute the ^UNIT command.
You can execute the ^UNIT command by:
® pressing 0 (ilTS) TOOLS ->UNiT
® selecting it from the commands catalog ((CAT) ->IINIT) or
• pressing 00 (i®)im)UNIT(Eii).
For example, entering 12 on level 2, 0ft on level 1 and executing the
^UNIT command returns 12_ft.
Unit prefixes
You can also insert a unit prefix in front of a mrit to indicate a power of
ten. The following table lists the available prefixes. (To key in p, press
0M.)
Unit PreRxes
PrefixName
Yyotta
Z
E
P
Ttera
G
Mmega
k or Kkilo
h or Hhecto+2
D
Unit objects
zetta+21
exa
peta
giga
deka
Exponent
+24
+ 18
+ 15
+12
+9
+6
+3
+1
Prefix
d
ccent
m
p
n
r
ffemto
a
z
y
NameExponent
deci
-2
milli-3
micro-6
nano
pico-12
atto-18
zepto-21
yocto
^9
-15
-24
Page 6-3
Converting units
The HP 49G provides two commands for converting imit objects from one
unit of measurement to another:
® CONVERT
® DBASE.
Tire CONVERT command—which requires two arguments—can be used to
convert one type of imit to any other similar miit. The DBASE conunand—
which requires only one argument—is used to convert a imit object to its
equivalent SI base imit: feet to metres, knots to metres per second, and so
on.
The following examples illustrate how to convert units if you are working
in algebraic mode. The steps to follow if you are working in RPN mode are
given at the end of the procedure.
To convert from one unit to another
1. Press 0 iUNITgl TOOLS CONVERT.
2. Enter the imit object with the units that you want to convert.
Example: 12_m
3. Press 0Q.
4. Enter a imit object with the imits you want the first imit object
converted to.
Example: l„ft
It does not matter what value you give to the number part of this imit
object.
5. Press (ENJR).
Example result: 39.3700787402_ft
In RPN mode: follow steps 2, 4, and 1.
If you are converting an angle measurement to imits of the same
type as your current angle measurement setting, you can omit the
unit expression at step 4 above.
For example, if your current angle measurement setting is radians,
you can convert 1000_arcmin to radians by entering
CONVERT(1000_arcmin, 1) and pressing
Page 6-4
(ENTER).
Unit objects
To convert units to SI base units
The CONVERT command discussed in the previous section can be used to
convert to any specified units, SI units or otheiTvise. If you want to
convert a rmit object to its equivalent SI base imits, the UBASE command is
quicker, as it requires just one argument.
• comparisons of values (dimensionally consistent imits only)
• trigonometric operations (planar angular imits only)
Where possible, units are automatically converted during the calculation.
In such cases, the result is expressed in the units of the last imit object
entered.
Note that some operations require certain imit objects to be enclosed in
parentheses if you are working in algebraic mode. This is illustrated in the
examples given in the next section.
Unit objects
Page 6-5
The trigonometric operations SIN, COS, and TAN, operate only on unit
objects with-planar ang-ular units: radians (r), degrees (°), grads (grad),
arc-minutes (arcmin), or arc-seconds (arcs).
Temperature units require special attention: see “Working with
temperatiue imits” on page 6-8.
Sample unit calculations
The following examples assume that you are working in algebraic mode.
Subtraction. To subtract 39 in from 4 ft:
1. Enter 4_ft.
2. Press
3. Enter 39Jn.
4.
Press
In RPN mode: follow steps 1, 3, and 2.
Unit multiplication and division. To multiply 50 ft by 45ft and divide
The answer is 9„in. Note that the answer takes the imits of the last
entered unit object. If you had subtracted 4ft from 39in, the answer
would be in feet.
Note that when you are in algebraic mode and multiplying or dividing
unit objects, or raising a imit object to a power, the miit object must be
entered in parentheses. (The one exception is the last imit object you
specify.)
Note that the last unit object does not need to be entered in
parentheses.
The answer is 750_ft2/d.
In RPN mode: follow steps 1, 3, 2, 5, and 4. Parentheses are not required
aroimd unit objects in RPN mode.
Page 6-6
Unit objects
Powers. To cube 2ft/s.
1. Enter (2_ft/s).
Note that when you are in algebraic mode and raising a imit object to a
power, the unit object must be entered in parentheses.
In RPN mode: follow steps 1, 3, and 2. Parentheses are not required
around unit objects in RPN mode.
Percentages. To find what percentage of 4.2cm^ is lin^:
1. Press
2. Enter l_in^3.
3. Press 0Q.
4. Enter 4.2_cm^3.
5. Press (EB).
0 (MlB)
real %t.
The answer is 25.6299725198.
In RPN mode: follow steps 2, 4, and 1.
Unit objects
Page 6-7
Factoring unit expressions
The UFACT command factors one unit within a unit object, returning a
luiit object whose unit expression consists of the factored unit and the
remaining SI base units.
To Factor units within a unit expression
1. Press 0 ÌUN0 TOOLS UFACT
2. Enter the imit object with the original imits.
Example; 74_pdl.
4. Enter any number (such as 1) and attach the imits you want to factor
out.
Example: 10g.
5. Press ¡Hi).
Answer: 10.2308666238_kgm/s^.
In RPN mode: follow steps 2, 4, and 1.
Working with temperature units
The HP 49G lets you work with temperature imits in the same way that
you work with other units. However, you need to be alert to the difference
between temperature level and temperature difference. For example, a
temperatine level of 0°C means “the freezing point of water”, but a
temperatine difference of 0°C means “no change.”
When °C or °F represents a temperatine level, the temperatine is a unit
with an additive constant: 0°C = 273.15 K, and 0°F = 459.67°R. But when
°C or °F represents a temperature difference, the temperature is a unit
with no additive constant: 1°C = 1 K, and 1°F = 1°R.
Page 6-8
Unit objects
Converting temperature units
Conversions between the four temperature scales (K, °C, °F, and °R)
involve additive constants as well as multiplicative factors. The additive
constants are included in a conversion when the temperatiue units reflect
actual temperature levels, and are ignored when the temperature units
reflect temperature differences.
• Pure temperature units (levels). If both unit expressions consist of
a single, unpreflxed temperature unit with no exponent, the CONVERT
command performs an absolute temperature scale conversion which
includes the additive constants.
• Combined temperature units (differences). If either unit
expression includes a prefix, an exponent, or any unit other tiran a
temperature unit, the CONVERT command perfonns a relative
temperature unit conversion which ignores the additive constants.
The two examples below illustrate these differences.
Example 1: Convert 25°C to °F.
1. Press 0 íDÑÍTS) TOOLS CONVERT.
2. Enter 25„°C.
3. Press 0Q.
4. Enter L°F.
It does not matter what value you give to the number part of this unit
object.
5. Press (Em).
The answer is 77 °F.
In RPN mode: follow steps 2, 4, and 1.
Unit objects
Page 6-9
Example 2: Convert 25°C/min to °F/min.
Note that unlike in the first example, in this example a relative
temperature conversion will be performed.
1. Press 0 iOirS] TOOLS CONVERT.
2. Enter 25_°C/min.
Note that °C/min is not available in the units catalog and so must be
created. You can select °C from the units catalog, and then press 0
and type “min” to complete the compound unit. (Note that min must
be entered in lower case.)
3. Press 0Q.
4. Enter l_°F/mm.
It does not matter what value you give to the number part of this mrit
object.
5. Press (ll).
The answer is 45_°F/min.
In RPN mode: follow steps 2, 4, and 1.
Page 6-10
Unit objects
Chapter 7
Constants Library
The constants libraiy contains a collection of conunonly used physical
constants and quantities. You can use them in equations and programs.
The following table lists the constants in the order they appear in the
library.
Abbrev
iation
NA
k
Vm
R
StdT
StdP
a
c
eO
|i0
g
G
h
hbar
Description
Avogadro’s number
Boltzmann constant
Molar volume
Universal gas constant
Standard temperature
Standard pressure
Stefan-Boltzmann constant
Speed of light in vacuum
Permittivity of vacuum
Permeability of vacuum
Acceleration of gravity
Gravitational constant
Planck’s constant
Dirac’s constant
Value (SI)
6.0221367E23 gmopl
1.380658E-23 J/K
22.4141 Pgmol
8.31451 J/(gmol-K)
273.15 K
101.325 kPa
5.67051E-8 W/Cm^.K-l)
299792458 m/s
8.85418781761E-12 F/m
1.25663706144E-6 H/m
9.80665 m/s^
6.67259E-11 m^/Cs^-kg)
6.6260755E-34 J-s
1.05457266E-34 J-s
q
me
qme
Constants library
Electron charge
Electron rest mas
q/me
1.60217733E-19 C
9.1093897E-31 kg
175881962000 C/lcg
Page 7-1
Abbrev
iation
DescriptionValue (SI)
mp
Proton rest mass1.6726231E-27 kg
mpmemp/me
a
0
Fine stmcture constant0.00729735308
Magnetic flux qiiantiuTi2.06783461E-15 Wb
FFaraday constant
R.X.
aO
,uB
Rydberg constant
Bohr radius0.0529177249 nm
Bohr magneton
l-iNNuclear magneton
?t0
Photon wavelengtlr (cli/e)
fOPhoton frequency (e/lr)
Xc
Compton wavelength
rad1 radian
tWOTI2Tt radians
angl
c3
in trig mode
Wien displacement constant
1836.152701
96485.309 C/gmol
10973731.534 nci
9.2740154E-24 J/T
5.0507866E-27 J/T
1239.8425 nm
2.4179883E14 Hz
0.00242631058 nm
1 radian
6.28318530718 radians
180°
0.002897756 m-K
kq
ICq
eOqsO/q
qeOq*Eo
esi
£OXSi02 dielectric constant
10
Page 7-2
Dielectric constant
Reference intensity
0.00008617386 J/(K-C)
55263469.6 F/(m-C)
1.4185979E-30 F-C/m
11.9
3.9
0.000000000001 W/n£
Constants library
To view the constants library
1. Press (№PS) CONSTANTS LIB.
2. Press (ENTER).
In RPN mode: follow step 1 only.
To view the value and units oF a particular constant
1. Highlight the constant whose value you want to see.
You can either press ® or @ rmtil the constant is highlighted, or press
(IM) followed by the first character of the constant’s abbreviation. For
example, to quickly find the acceleration of gravity, enter (IM) 0 G.
(The left-shift key is needed because the abbreviation for the
deceleration of gravity is a lower-case g.)
2. Press VALUE.
The numerical value of the constant is displayed.
3. If the imits are not displayed and you wish to see them, press units.
4. If SI units are displayed and you prefer imperial imits, press engl.
(Alternatively, if imperial imits are displayed and you prefer to see SI
imits, press SI.)
To copy a constant to the stack or history
1. Highliglit the constant whose value you want to copy.
You can either press @ or (0 imtil the constant is highlighted, or press
(IM followed by the first character of the constant’s abbreviation.
2. If you want to copy the value and its imits, display the units. (If the
units are not displayed, press units.)
3. Press —>STK.
Once copied to the stack or history, you can include the value or imit
object in calculations.
To return to the stack or history, press QUIT or (CANCB}.
Constants library
Page 7-3
To include a constant in an algebraic
expression
You can include a constant in an expression you are creating on the
command line or in Equation Writer.
1. At the position in the expression where you want to include a constant,
type CONST.
2. Press 00.
3. With the cursor between the parentheses, type the abbreviation for the
constant.
For example: 4.56*CONST(g).
When the expression is evaluated, the constant is also evaluated. (In the
above example, the answer, in SI units, is 44.718824jn/s^.)
Page 7-4
Constants library
Chapter 8
Number bases
Entering and displaying binary integers
You can enter and display integers in one of four fonns:
4. Press dH).
In RPN mode: follow steps 1, 3, and 2.
The two binaiy integers do not have to be to the same base.
The answer is expressed in the cuiTent base setting, and the two
arguments are converted to that setting.
Note that any remainder from a division is lost and the answer is
tmncated to be an integer.
To find the negative of a binary integer
1. Press (C0 NEG.
2. Enter the binary integer.
3. Press (Hr).
In RPN mode: follow steps 2 and 1.
The negative of a binary number is its two’s complement (all bits inverted
and 1 added).
Number bases
Page 8-3
To convert a binary integer to a diFFerent number base
1. Press (CAT) n, where n is the command that represents the base you
want to convert to: DEC, BIN, HEX, or OCT.
2. Enter the binary integer.
3. Press
For example, to convert # 1101b to hexadecimal, enter HEX(# 1101b) and
press
(ENTER).
In RPN mode: follow steps 2 and 1.
Note that converting a binaiy integer to a different number base also
changes the base setting to the base that you converted the integer to.
To convert a binary integer to a real number
1. Press (r) (bM)b^R.
2. Enter the binary integer.
For example, # 3Ah.
3.
Press
(ENTER).
The answer is 58.
In RPN mode: follow steps 2 and 1.
To convert a real number to a binary integer
1. Set the base to the type that you want to convert to. See “To set the
base” on page 8-1.
2. Press 0(H)R->B.
3. Enter the real number.
4.
Press
(ENTER).
In RPN mode: follow steps 2 and 1.
If necessary, the real nmnber is rounded to an integer before converting.
Negative real niunbers are converted to # 0 and real numbers
> 1.84467440738 x 10^® are converted to the largest binary integer
(# FFFFFFFFFFFFFFFFH, for example).
Page 8-4
Number bases
Using Boolean operators
The HP 49G provides a number of commands that enable you to perfonu
Boolean operations and comparisons on binary integers. These
commands—available by pressing 0 (B^ LOGIC—are illustrated in the
following table. The input syntax shown assumes that you are in algebraic
mode.
Examples
Commands
InputOutput
AND Logical bit-by-bit
AND of two arguments.
Compares corresponding
bits and returns true (1) if
both bits are 1.
NOT Returns the one’s
complement of the argu
ment. Each bit in the result
is the complement of the
corresponding bit in the
argument.
OR Logical bit-by-bit OR
of two arguments. Com
pares corresponding bits
and returns true (1) if either
bit is 1.
# 1100b AND# 1010b#1000b
NOT (#11 lb)
# 1100b OR# 1010b#lllOb
#Liiiimoooob‘>
XOR Logical bit-by-bit
exclusive OR of two argu
ments. Compares couesponding bits and returns
true (1) if only one of the
bits is 1.
aThis answer assumes that the wordsize has been set to 12.
Number bases
# 1101b XOR# 1011b# IlOb
Page 8-5
Manipulating bits and bytes
The following commands enable you to manipulate binaiy integers one bit
or one byte at a time. The commands are available by pressing o (BASEjbit
OR 0 (0E)byte. Unless otherwise stated, each example assumes the
wordsize is set to 24.
Example
Commands
InputOutput
ASR Arithmetic Shift Right. Per
forms 1 bit arithmetic right shift.
The most significant bit is regener
ated.
RL Rotate Left. Binary integer
rotates left one bit. (The example
assumes that the wordsize is 4.)
#1100010b
# 1100b# 1001b
#110001b
RLE Rotate Left Byte. Binary inte
ger rotates left one byte.
RR Rotate Right. Binary integer
rotates right one bit. (The example
assumes that the wordsize is 4.)
RRB Rotate Right Byte.
Binary integer rotates right one
byte.
SL Shift Left. Binary integer shifts
left one bit.
SLB Shift Left Byte. Binary integer
shifts left one byte.
SR Shift Right. Binary integer
shifts right one bit.
SRB Shift Right Byte. Binary inte
ger shifts right one byte.
# FFFFh# FFFFOOh
# 1101b#1110b
# AOBOCOhCOAOBOh
# 1101b
# AOBOh# AOBOOOh
#llOllb# 1101b
# AOBOCOh# AOBOh
#11010b
Page 8-6
Number bases
Chapter 9
Lists and Sequences
Creating Lists
To enter a List From the keyboard
1. Press CQ}. The braces indicate the beginning and end of a list.
2. Enter the elements of the list, separating each with a comma (0Q).
3. Press (ENTER).
Note that the list is displayed without commas.
To assemble a list from a set oF stack objects
If you are worMng in RPN mode, you can assemble a list from a
contiguous set of objects already on the stack.
1. Enter the objects on the stack (or place them at the bottom of the
stack: level 1, level 2, and so on).
2. Enter the number of objects you want in the list on tire first level of the
stack.
3. Execute the ^LIST command to convert the objects to a list.
The TO LIST command can be executed by pressing Q (P@ LIST ^LIST.
4. Press (H).
In RPN mode: follow steps 1, 3, and 2.
List Processing
To apply a one-argument command to each element in a
list
The order in which you enter the command and tire list depends on the
type of function it is: prefix or postfix.
A prefix function is one whose name or abbreviation usually comes
before its arguments; for example, SIN^) and SQ(x, y).
Apostfix function is one whose name or abbreviation usually comes
after its arguments; for example, 6!.
The followmg example shows how to the apply a one-argument prefix
conunand to a list if you are working in algebraic mode. The table below
the example gives the order of the steps for postfix frmctions, and for
when you are working in RPN mode.
1. Enter or select the command.
For example, SQ().
2. Enter or select the list.
For example, SQ({3, 4, 5|).
3.
Press
(ENTER).
The answer is a new list, with each element the square of each element
in the original list: {9, 16, 25}.
Page 9-2
Lists and Sequences
If you are executing a postfix fxmction, or working in RPN mode, the steps
you should take are given in the following table.
Prefix
Algebraic
RPN2, 3, 1
1, 2, 3
Postfix
2, 1,3
2, 1
Another example: To find the factorial of 3, 4, and 5 while working in
algebraic mode.
1. Enter or select the list; ¡3, 4, 5).
2. Select the factorial command:
Q (ME)
PROBABILITY !
3. Press (ENTER).
The answer is {6, 24,120).
To add corresponding elements of two Lists
1. Enter or select the first list.
For example, {4, 7, 9).
2. Select the ADD command.
0 (ME) LIST ADD
3. Enter the second list.
For example, {2, -4, -8).
The number of elements in the second list must be the same as the
number of elements in the first list.
4. Press (ENTER).
The answer is {6, 3, 1).
In RPN mode: follow steps 1, 3, and 2.
Lists and Sequences
Page 9-3
To concatenate two lists
To concatenate two lists is to form a list made up of the elements of botlr
lists. The order of tire elements in each sub-list is preseiwed.
1. Enter the list whose elements will form the first part of the
concatenated list.
3. Enter the list whose elements will fomi the latter part of the
concatenated list.
For example, {4, 5, 6}.
4.
Press
(ENTER).
The answer is {1, 2, 3, 4, 5, 6j.
In RPN mode: follow steps 1, 3, and 2.
To subtract, multiply, or divide corresponding elements of
two lists
1. Enter the first list.
2. Press 0, ®, or 0.
3. Enter the second list.
The number of elements in the second list must equal the nmnber of
elements in the first list.
4. Press (eH).
In RPN mode: follow steps 1, 3, and 2.
For example, {2, 4, 7} ® ¡3, 5, -4) yields (6, 20, -28).
Page 9-4
Lists and Sequences
Applying a Function or program to a List
The DOLIST coiranand enables you to run programs or execute fmrctions
on groups of lists.
To run a program or execute a Function on Lists
When you are operating on a number of lists—especially long lists—it
may be easier and clearer if you are in RPN mode (as in the case of the
following example).
1. Enter the lists.
2. Enter the number of lists to be operated on. This number is the number
of elements in each list operated on in each iteration of the function or
program.
3. Enter a program or function.
4. Execute DOLIST.
Example; Apply the function defined by a,u + (6„ x c„) to three lists,
a, b, and c.
1. Enter the lists.
For example, ¡1, 2, 3, 4), {4, 5, 6, 7}, and ¡7, 8, 9, 11|.
2. Enter the number of lists to be operated on (for example, 3).
3. Enter the fimction.
« * + »
4. Execute the DOLIST command.
0 {PRG)lIST procedures DOLIST
The answer is {29, 42, 57, 81).
To apply a procedure sequentially to elements of a list
The DOSlJBS command enables you to apply a program or function to the
elements in the list one after the other. In RPN mode, the procedure is;
1. Enter the list.
2. Enter the frame index. This is the number of elements affected by each
iteration of the fimction. For example, entering 3 would take 3
elements from the list and use them as arguments for the fimction.
3. Enter a program or function.
4. Execute DOSUBS.
Lists and Sequences
Page 9-5
Example: Find the 2-element moving average of {2, 4, 8, 16, SOj.
1. Enter the list.
2. Enter the frame index.
In this example, the number is 2, as you want to find the average of tv)o
nimibers each time.
3. Enter the program.
« + 2 / »
4. Execute the DOSUB command.
0 {mg) LIST PROCEDURES DOSIJBS.
The answer is ¡3, 6, 12, 33).
To execute a function on every element of a list
The STREAM command enables you to apply a fimction I'ecursively to every
element in a list. The command takes the first two elements, executes a
function, takes the result and the next element, executes the fimction
again, and so on, until there are no more arguments for the function to
work on.
In RPN mode, the steps are:
1. Enter the list.
For example, { 1 2 3 4 5).
2. Enter a program or fimction that takes two arguments and returns one
result.
For example, « * ».
3. Execute STREAM.
0 ® LIST PROCEDURES STREAM.
hr this example, the fimction multiplies all the elements in the list. The
answer is 120.
You can also use the product list command to calculate the product of all
the elements in a list. See “To find the product of the elements in a finite
list” on page 9-10.
Page 9-6
Lists and Sequences
List Manipulations
The following functions provide ways to manipulate the elements of a list:
Function
Q (MTHl LIST SORT
Sorts the elements in a list in ascending order. In RPN
mode, the list must be on level 1.
Description
0 (MÌB) LIST EEVLISTReverses the order of the elements in a list. In RPN
mode, the list must be on level 1.
0 (PRGIlIST ELEMENTS
HEAD
0 (@G)listelementstail
0 (re) LIST ELEMENTS GET
0 (ire) LIST ELEMENTS GETI
Returns the first element in the list. In RPN mode, the
list must be on level 1.
Returns a list of all the elements in the list except the
first element. In RPN mode, the list must be on
level 1.
Returns the element in the list (argument 1/level 2) cor
responding to a specified position (argument 2/leveI 1).
For example, GET({ 1,4, 7, 8}, 3) returns 7, since 7 is
the third element in the list.
Similar to the GET command (see above) but also
returns the specified position number incremented by 1
(and the original list). For example, GETI({ 1,4, 7, 8},
3) returns {1, 4, 7, 8}, 4 (the specified position number
+ 1), and 7 (the third element in the list).
0 (re) LIST ELEMENTS PUT
Replaces an element at a particular position (argument
2/level 2) of a list (argument 1/level 3), with a new ele
ment (argument 3/level 1). For example, PUT({ 1, 2, 3),
2, 5) returns {1, 5, 3}.
0 (00 LIST ELEMENTS PUTÌ
0 (00 LIST ELEMENTS SIZE
Lists and Sequences
Similar to the PUT command (see above) but also
returns the specified position number incremented by 1.
For example, PUTI({ 1, 2, 3), 2, 5) returns {{1, 5, 3},
3}.
Returns the number of elements in a list. In RPN mode,
the list must be on level 1.
Page 9-7
Function (Continued)
Description
0 (flGlLIST ELEMENTS POS
0 (PEG) LIST
0 {® LIST SUB
0 ® LIST REEL
Returns the position of the first occurrence of an ele
ment (argument 2/level 1) in a specified list (argument
1/level 2). For example:
POS({2, 4, 6, 1, 2, 3, 4), 4) returns 2 (since the first
occuiTence of 4 is at position 2 in the list.
RPN command to disassemble a list into its elements
and return (to level 1) the number of elements that were
in the list. Each element is placed on a separate level of
the stack.
Creates a sub-list of elements from a list (argument
1/level 3) starting with the element at one position
(argument 2/level 2) and ending with the element at
another position (argument 3/level 1). For example,
SUB(¡1,2,3, 4, 51,2,4} returns ¡2,3,4}.
Replaces the elements of a list (argument 1/level 3)
with the elements from another list (argument 3/level 1)
starting at a specified position (argument 2/level 2). For
example,
REPL((6, 7, 8, 2}, 2, ¡1,2. 3} returns ¡6, 1, 2,3 |.
Page 9-8
Lists and Sequences
Sequences
Sequence commands automate the generation of a list from the repeated
execution of a fimction or program.
To generate a sequence
In algebraic mode:
1. Specify the sequential calculation command.
0 {PRG) LIST PROCEDURES SEQ.
2. Enter the function or program (or its name).
3.
Enter the index variable name.
4.
Enter tire initial value for the variable.
5. Enter the final value for the variable.
6. Enter tire step size of the increment.
The number of elements generated is the integer portion of {{f inal -
initiaiystejf + 1.
7. Press
In RPN mode: follow steps 2,
3, 4,
5, 6, and 1.
Example: Generate a list of the squares of the integers from 15 to 19.
1. Press 0 (PRG) LIST PROCEDURES SEQ.
2. Enter 0О0
0x®
® and press 0Q.
Note that tick marks are needed to delimit the algebraic object.
19 is the final value, that is, the value used in the last iteration.
6. Enter 1.
1 is the step value, that is, by how much the initial value will be incre
mented after each iteration.
7. Press '
The result is ¡225, 256, 289, 324, 361).
Lists and SequencesPage 9-9
If you had entered 2 for the step value at step 6, then every second integer
in the specified range would have been included in the iterations, and the
result would have been ¡225, 289, 361 j.
To find the sum of the elements in a finite List
1. Select tire list sum command.
0 (MDi) LIST Slist
2. Enter or select the list.
For example, ¡2, 4, 7].
3. Press (ENTER).
The answer is 13.
In RPN mode: follow steps 2 and 1.
To find the product of the elements in a finite list
1. Select the list product commaird.
0 O LIST PLIST
2. Enter or select the list.
For example, (2, 3, 4).
3. Press (ENTffl).
The answer is 24.
In RPN mode: follow steps 2 and 1.
To find the set of first differences of a finite sequence
The first differences for the list {X2 ■ ■ ■ } is defined as
{X2-X1
1. Select the list diffemces conmrand.
0 (MTH) LIST Dlist
2. Enter or select the list.
For example, ¡2, 5, 11, 13, 33|.
3. Press (ENTER).
The answer is ¡3, 6, 2, 20).
In RPN mode: follow steps 2 and 1.
Page 9-10
Lists and Sequences
Chapter 10
Advanced plotting options
Labelling and relocating the axes
To label the coordinate axes with the variable names
The names of the independent and dependent variables, and the
coordinates (in user-units) of the largest and smallest displayed values for
each variable, can be added to the plot after it has been drawn. The figm'e
below shows labels added to the plot of y
have used the default settings).
X - 2 (assuming that you
To label the axes:
1. Press EDIT.
2. Press (MD to display the second page of the fimction-key menu.
3. Press LABEL.
You may need to hide the menu to see the lowest label on the vertical
The following diagram is of the same plot as in the previous illustration,
but the axes now meet where x =1 and y =1.
Plotting programs
You can plot a program if it takes nothing from the stack, uses the
independent variable in the program, and returns exactly one mrtagged
number to the stack.
Examples
® Real result. Equivalent to the expressions/(,x) (function plots) and
'r(6) (polar plots). For example, the program:
« IF 'X<0' THEN ' 3*X''3-45X"'2 + 350 ' ELSE 1000 END »
plots/(x) = 3,x^-45x^+350 if x<0 and/(x) = 1000 if ,x>0.
Store the program in EQ, select autoscaling, and draw the plot.
® Complex result. Equivalent to (x(i), i/(0) (parametric plots). For
example, the program:
« 't^2-2' ^NUM 't"3-2t + l' ->NUM R^C »
plots the parametric equations x = t^-2 and x =
Store the program in EQ, make f the independent variable, select
autoscaling, and draw the plot.
Advanced plotting options
Page 10-3
Plotting range vs. display range
The plotting range is the range of the independent variable (or variables)
over which the current equation is evaluated. If you don’t specify the
plotting range, the HP 49G uses the a;-axis display range (specified by
XRNG or by H-VIEW) as the plotting range. However, you can specify a
plotting range that is different from the ir-axis display range:
• For polar and parametric plots, the independent variable isn’t related
to the x-axis variable; therefore you specify the plotting range to
control the range of the independent variable.
* For truth and conic plots, you can shorten plotting time by specifying
plotting ranges that are smaller than the x- and y-axis display ranges.
These plot types require you to specify the dependent variable. You can
specify a plotting range different from the ?/-axis display range.
You can make PICT larger than its default size (131 by 64 pixels) and
either keep the same x and y scale factors (which extends the display
range), or keep the same display range (which extends the scale and
appears to stretch the plot.
To check the current size oF PICT
1. Press o (Rty to select the Recall command.
2. Type PICT.
3. Press
The message “Graphic width x height” is returned, indicating the
current dimensions of PICT.
In RPN mode: follow steps 2 and 1.
To change the size oF PICT
To keep the same scaling:
1. Press 0 (ED PICT PDM to select the pictdimensioncommand.
2. Enter a complex niunber to indicate the coordinates, in user imits, of
one comer of PICT.
3. Press 0Q.
Page 10-4
Advanced plotting options
4. Enter a complex niuxiber to indicate the coordinates, in user units, of
the comer of PICT diagonally opposite the comer specified at step 2
above.
For example, PDM((-6,-6), (6,9)).
5. Press (ENTER).
Press 0 (GRM) to see the results of the re dimensioning of PICT.
In RPN mode: follow steps 2, 4, and 1.
To keep the same display ranges:
1. Press 0 (PRG) PICT PDM to select the PICT dimensioncommand.
2. Enter a binary integer to indicate the horizontal size of PICT in pixels.
4. Enter a binary integer to indicate the vertical size of PICT in pixels.
For example, PDM(#105h, #3Fh).
5.
Press
(ENTER).
Press 0 (gMph) to see the results of the redimensioning of PICT.
In RPN mode: follow steps 2, 4, and 1.
The result of the PDIM command depends on the type of coordinates—
user-units or pixels—although both fomis change the size of PICT.
To use computed values for plotting or
display ranges
1. On the Plot Window input form, highlight the range field whose value
you wish to compute.
2. Press the function key corresponding to the variable containing the
plot picture.
You may have to press (NXT) a number of times to display the variable
you want. You may also have to change directories if the variable is not
in the current directory.
3. Press ® to display the plot.
To save a reconstructable version oF the current plot
1. After drawing the plot, press (CANCEp to return to your default screen.
2. Press 0(0].
3.
Press
4. Press
5. Press 0GO.
6.
Press
7. Press 0Q.
8. If your plot was three-dimensional, press VPAR and 0O.
9. Press 0D
10.
Press ® until the cursor is outside the list.
11.
Press (10.
12.
Enter a name for the list.
13. Press (ENTg).
(WR).
EQ.
PPAR.
RCLF.
Advanced plotting options
Page 10-7
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.