I Function |
The I function creates an identity matrix with dim rows and columns. The diagonal elements of an identity matrix are ones; all other elements are zeros. The value of dim must be an integer greater than or equal to 1. Noninteger operands are truncated to their integer part.
For example, the following statements compute a identity matrix:
a = I(3); print a;
a | ||
---|---|---|
1 | 0 | 0 |
0 | 1 | 0 |
0 | 0 | 1 |