![]() |
VOOZH | about |
sympy.eye() method, we can find the identity matrix by using sympy.eye() method.
Syntax : sympy.eye()
Return : Return an identity matrix.
Example #1 :
In this example, we can see that by using sympy.eye() method, we are able to find identity matrix having dimension nxn, where n will be pass as a parameter.
Output :
Matrix([ [1, 0, 0], [0, 1, 0], [0, 0, 1]])Example #2 :
Matrix([ [1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1]])