|
Identity
It is a static function which creates an identity matrix of the specified size (not necessarily square). An identity matrix contains ones on the main diagonal and zeros elsewhere. The main diagonal consists of the matrix elements having equal row and column indexes, such as [0,0],[1,1],[2,2] etc. Creates a new identity matrix.
There is also the method Identity that transforms an already existing matrix into an identity one.
static matrix matrix::Identity(
|
Parameters
rows
[in] Number of rows (and columns) in n x n matrix.
Return Value
Return the identity matrix. The identity matrix is a square matrix with ones on the main diagonal.
MQL5 example:
matrix identity=matrix::Identity(3,3);
|
Python example:
np.identity(3)
|