map
There are two uses for this function, in which the second argument is always a mapping of a variable onto an
expression. If the expression is a function of the variable, the function is applied to each element in the vector
or matrix (the rst argument) and the resulting vector or matrix is returned; if the expression is a Boolean
test, each element in the vector or matrix is tested and the results are returned as a vector or matrix. Each
test returns either 0 (fail) or 1 (pass).
map(Matrix, Var → Function) or map(Matrix, Var → Test)
Example:
map([1 2 3], x→x
3
) returns [1 8 27]
map([1 2 3], x→ x>1) returns [0 1 1]
mat2list
Returns a vector containing the elements of a matrix.
mat2list(Matrix)
Example:
mat2list([[1 8],[4 9]]) gives [1 8 4 9]
matpow
Given a matrix and an integer n, returns the nth power of the matrix by jordanization.
matpow(Matrix, Integer)
Example:
matpow([[1,2],[3,4]],n) gives [[(sqrt(33)- 3)*((sqrt(33)+5)/2)^n*-6/(-12*sqrt(33))+(-
(sqrt(33))-3)*((-(sqrt(33))+5)/2)^n*6/(- 12*sqrt(33)),(sqrt(33)-3)*((sqrt(33)+5)/ 2)^n*(-(sqrt(33))-3)/
(-12*sqrt(33))+(- (sqrt(33))-3)*((-(sqrt(33))+5)/2)^n*(- (sqrt(33))+3)/(- 12*sqrt(33))],[6*((sqrt(33)+5)/
2)^n*-6/(- 12*sqrt(33))+6*((-(sqrt(33))+5)/2)^n*6/(- 12*sqrt(33)),6*((sqrt(33)+5)/2)^n*(- (sqrt(33))-3)/
(-12*sqrt(33))+6*((- (sqrt(33))+5)/2)^n*(-(sqrt(33))+3)/(- 12*sqrt(33))]]
matrix
Given two integers p and q, makes a matrix with p rows and q columns, lled with zeroes. Given a value as a
third argument, returns a matrix lled with that value. Given a mapping using j and k, uses the mapping to ll
the matrix (j is the current row and k the current column). This function can be used with the apply command
as well.
matrix(p, q, [Value or Mapping(j,k)])
Example:
matrix(1,3,5) returns [5 5 5]
MAXREAL
Returns the maximum real number that the HP Prime calculator is capable of representing in Home and CAS
views: In the CAS, MAXREAL=1.79769313486*10
308
In Home view, MAXREAL=9.99999999999E499
442 Chapter 22 Functions and commands
Komentarze do niniejszej Instrukcji