beautypg.com

HP Prime Graphing Calculator User Manual

Page 482

background image

478

Matrices

by the number of elements (e) instead of the number of
rows and columns.

MAKEMAT(expression, rows, columns)

MAKEMAT

(

expression, elements

)

Examples:

MAKEMAT(0,3,3) returns a 3 × 3 zero matrix,
[[0,0,0],[0,0,0],[0,0,0]].

MAKEMAT(√2,2,3) returns the 2 × 3 matrix
[[√2,√2,√2],[√2,√2,√2]].

MAKEMAT(I+J–1,2,3) returns the 2 × 3 matrix

[[1,2,3],[2,3,4]]
Note in the example above that each element is the
sum of the row number and column number minus 1.

MAKEMAT(√2,2) returns the 2-element vector
[√2,√2].

Identity

Identity matrix. Creates a square matrix of dimension
size × size whose diagonal elements are 1 and off-
diagonal elements are zero.

IDENMAT(size)

Random

Given two integers, n and m, and a matrix name, creates
an n x m matrix that contains random integers in the range
−99 through 99 with a uniform distribution and stores it in
the matrix name.

randMat(MatrixName,n,m)

Example:

RANDMAT(M1,2,2) returns a 2x2 matrix with

random integer elements, and stores it in M1.

Jordan

Returns a square nxn matrix with expr on the diagonal, 1
above and 0 everywhere else.

JordanBlock(Expr,n)

Example:

JordanBlock(7,3) returns

7 1 0
0 7 1
0 0 7