- How do I create a matrix easily?

The matrix writer is the easiest method to not only create, but also view and edit

a matrix in the HP50G.

You can access it via the LSH MTRW buttons.

After entering the elements of the matrix completely, press the ENTER key

then store it into a variable to avoid reentering the values.

Special commands such as deleting a row or a column may be learned from

the HP 48G User's guide, Chapter 14.

- I want to create a matrix directly. How do I enter the elements of the matrix?

Press LSH [] LSH [] to mark the delimiters of the matrix.

Enter the elements of the first row, using SPC to separate them. (no need to type a comma in RPN mode)

Press RIGHT button to to move the cursor after the ] row delimiter.

Press LSH [] to start a new row. When done, press ENTER.

- How do I create an identity matrix?

The identity matrix of size (n x n) may be created by the function`idn(n)`.

- How do I create a constant matrix?

The constant matrix of size(m x n) with all values c may be created by the function

`con({m,n}, c)`.

- How do I create a matrix with specified elements along the diagonal?

Use the`diag->({m,n),[d1, ..., dn]`function. It requires the dimension of the matrix and a vector or the diagonal elements.

Q. Define a zero matrix of size 4,4

- How do I define a square matrix of random integers?

Use the`randm(n)`function which will return an (n x n) matrix.

- How do I transpose a matrix?

Use the trn(M) function. This will also return the conjugate transpose for complex matrices.

- How to I invert a matrix M.

There is more than one way to do it:`1/M, M^-1, inv(M)`

- How do I define a Vandermonde matrix?

The command for creating a square Vandermonde matrix is to specify the vector X. The output

is the matrix consisting of columns of 1, ang the columns of powers of X. Thus vandermonde([3,4,5]) will output

$$\begin{array}{lll} 1 &3 &9 \\1 &4 &16 \\1 &5 &25 \\ \end{array}$$

- How do I multiply each element of a matrix M by a constant k?

Simply type`k * M`.

- How do I add or subtract a constant from all elements of a matrix M?

There seeems to be no direct way. Create a constant matrix of the same size and

perform the corresponding addition or subtraction.

- How do I swap rows or columns of a matrix M?

Consult the manual for the commands RSWAP and CSWAP functions.

## Saturday, May 22, 2010

### HP 50G Basic linear algebra: Matrices

Subscribe to:
Post Comments (Atom)

## No comments:

## Post a Comment