Function cswp, Manipulating matrices by rows – HP 48gII User Manual

Page 321

Advertising
background image

Page 10-21


In RPN mode, place the matrix in the stack first, then enter the number
representing a column location before applying function COL-. The following
figure shows the RPN stack before and after applying function COL-.

Function CSWP

Function CSWP (Column SWaP) takes as arguments two indices, say, i and j,
(representing two distinct columns in a matrix), and a matrix, and produces a
new matrix with columns i and j swapped. The following example, in ALG
mode, shows an application of this function. We use the matrix stored in
variable A for the example. This matrix is listed first.

In RPN mode, function CSWP lets you swap the columns of a matrix listed in
stack level 3, whose indices are listed in stack levels 1 and 2. For example,
the following figure shows the RPN stack before and after applying function
CSWP to matrix A in order to swap columns 2 and 3:


As you can see, the columns that originally occupied positions 2 and 3 have
been swapped. Swapping of columns, and of rows (see below), is commonly
used when solving systems of linear equations with matrices. Details of these
operations will be given in a subsequent Chapter.

Manipulating matrices by rows

The calculator provides a menu with functions for manipulating matrices by
operating in their rows. This menu is available through the

Advertising
This manual is related to the following products: