Page 10-6
Functions GET and PUT
Functions GET, GETI, PUT, and PUTI, operate with matrices in a similar manner
as with lists or vectors, i.e., you need to provide the location of the element that
you want to GET or PUT. However, while in lists and vectors only one index is
required to identify an element, in matrices we need a list of two indices {row,
column} to identify matrix elements. Examples of the use of GET and PUT
follow.
Let’s use the matrix we stored above into variable A to demonstrate the use of
the GET and PUT functions. For example, to extract element a
23
from matrix A,
in ALG mode, can be performed as follows:
Notice that we achieve the same result by simply typing
(2,3
) and pressing
`
. In RPN mode, this exercise is performed by entering
@@@A@@@
` 3 `
GET
, or by using
(2,3)
`
.
Suppose that we want to place the value ‘
π
’ into element a
31
of the matrix.
We can use function PUT for that purpose, e.g.,
In RPN mode you can use:
J
@@@A@@@
{3,1}
` „ì
PUT
.
Alternatively, in RPN mode you can use:
„ì³
(2,3)
` K
. To
see the contents of variable A after this operation, use
@@@A@@@
.
Functions GETI and PUTI
Functions PUTI and GETI are used in UserRPL programs since they keep track of
an index for repeated application of the PUT and GET functions. The index list
in matrices varies by columns first. To illustrate its use, we propose the
following exercise in RPN mode:
@@@A@@@
{2,2}
`
GETI. Screen shots showing
the RPN stack before and after the application of function GETI are shown
below:
Summary of Contents for 50G
Page 1: ...HP g graphing calculator user s guide H Edition 1 HP part number F2229AA 90006 ...
Page 130: ...Page 2 70 The CMDS CoMmanDS menu activated within the Equation Writer i e O L CMDS ...
Page 206: ...Page 5 29 LIN LNCOLLECT POWEREXPAND SIMPLIFY ...
Page 257: ...Page 7 20 ...
Page 383: ...Page 11 56 Function KER Function MKISOM ...
Page 715: ...Page 21 68 Whereas using RPL there is no problem when loading this program in algebraic mode ...
Page 858: ...Page L 5 ...