DIAG

Type: Command

Description: Vector to Matrix Diagonal Command: Takes an array and a specified dimension and returns a matrix whose major diagonal elements are the elements of the array.

Real number dimensions are rounded to integers. If a single dimension is given, a square matrix is returned. If two dimensions are given, the proper order is { number of rows, number of columns }. No more than two dimensions can be specified.

If the main diagonal of the resulting matrix has more elements than the array, additional diagonal elements are set to zero. If the main diagonal of the resulting matrix has fewer elements than the array, extra array elements are dropped.

Access:

CREATELDIAG

 

 

 

 

( Ø is the left-shift of the 5key).

 

MATRIX LDIAG

 

 

 

 

( ´is the left-shift of the Pkey).

 

MATRIX MAKELLDIAG

( ´is the left-shift of the Pkey).

Input/Output:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Level 2/Argument 1 Level 1/Argument 2

Level 1/Item 1

 

 

 

 

 

 

 

 

 

 

 

[ array ]diagonals

 

{ dim }

[[ matrix ]]

See also:

→DIAG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DIAG

Command

 

 

 

 

 

 

Type:

 

 

 

 

 

 

Description:

Matrix Diagonal to Array Command: Returns a vector that contains the major diagonal elements

 

of a matrix.

 

 

 

 

 

 

 

The input matrix does not have to be square.

 

 

Access:

CREATE DIAG

 

 

 

 

( Ø is the left-shift of the 5 key).

 

MATRIX LDIAG

 

 

 

 

( ´is the left-shift of the P key).

 

MATRIX MAKE LLDIAG

( ´is the left-shift of the P key).

Input/Output:

 

 

 

 

 

 

 

 

 

 

Level 1/Argument 1

 

Level 1/Item 1

 

 

 

 

 

 

 

 

 

 

 

[[ matrix ]]

[ vector ]diagonals

See also:

DIAG→

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DIAGMAP

 

 

 

 

 

 

 

 

Type:

Command

 

 

 

 

 

 

Description:

Applies a holomorphic operator to a diagonalizable matrix.

 

Access:

Matrices, !Ø LEIGENVECTORS.

 

 

Input:

Level 2/Argument 1: A diagonalizable matrix.

 

 

 

Level 1/Argument 2: An operator, expressed as a function. The function can be stored in a

 

variable with DEF, or can be a program, or a single expression.

 

Output:

The matrix that results from applying the operator to the matrix.

 

Flags:

Exact mode must be set (flag –105 clear).

 

 

 

Numeric mode must not be set (flag –3 clear).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 1

 

 

 

Example:

Apply the operator ex to the matrix

 

0 2

 

 

 

 

 

 

 

 

 

3-58 Full Command and Function Reference