CALL IDENTITY Routine
Converts the input matrix to an identity matrix.
Category: |
Matrix Operations |
Requirement: |
The input matrix must be square. |
Note: |
Diagonal element values of the matrix will be set to
1, and the rest of the values will be set to 0.
|
Syntax
Required Argument
- X
-
specifies an input
matrix with dimensions m x m (that
is, X[m, m]).
Example
The following example
uses the IDENTITY CALL routine:
options pageno=1 nodate;
proc fcmp;
array mat1[3,3] (0.3, -0.78, -0.82, 0.54, 1.74, 1.2,
-1.3, 0.25, 1.49);
call identity (mat1);
put mat1=;
quit;
Output from the IDENTITY CALL Routine
The SAS System 1
The FCMP Procedure
mat1[1, 1]=1 mat1[1, 2]=0 mat1[1, 3]=0 mat1[2, 1]=0 mat1[2, 2]=1 mat1[2, 3]=0
mat1[3, 1]=0 mat1[3, 2]=0 mat1[3, 3]=1