numpy.matlib.identity(n,dtype=None)[source]¶Returns the square identity matrix of given size.
| Parameters: | n : int
dtype : data-type, optional
|
|---|---|
| Returns: | out : matrix
|
See also
numpy.identitymatlib.eyeExamples
>>>importnumpy.matlib>>>np.matlib.identity(3,dtype=int)matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1]])