HP (Hewlett-Packard) 50g Calculator User Manual


 
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: