
Help!I have no idea how to type the inverse Matrix and Matrix command.
Collapse
X
-
For working with matrices you could download and use the numpy module
and for finding out the inverse of a matrix of dimensions 2x2
you could use this for your personal computations
Code:A = [[a,b], [c,d]] inverse A = 1/det (A) [[d,-b], [-c, a]] where det (A) = ad - bc
-
Originally posted by kaarthikeyaprey anFor working with matrices you could download and use the numpy module
and for finding out the inverse of a matrix of dimensions 2x2
you could use this for your personal computations
Code:A = [[a,b], [c,d]] inverse A = 1/det (A) [[d,-b], [-c, a]] where det (A) = ad - bc
Can you teach me how to find the numpy module and download which particular part of it?
Thanks a lot.
I appreaciate you.
Regards.Comment
-
Originally posted by SpeedMathCan you teach me how to find the numpy module.
At the top of the page is a search box, into which you enter your query (in this case NumPy).
The results will then be displayed; the first of which is NumPy's Home pageComment
-
Just now I found this reference.
http://numpy.scipy.org/numpy.pdf
I am encountering a problem.
I am using Python25.
In the Python25, I think I have lack of some library or something else.
Because I couldn't Run the below command.
Below commands adapted from http://numpy.scipy.org/numpy.pdf , page 84.
from numpy import *
from scipy import *
a = reshape(arange( 25.0), (5,5)) + identity(5)
print a
inv_a = inverse(a)
print inv_a
maximum.reduce( fabs(ravel(dot( a, inv_a)-identity(5))))
_______________ _______________ _______________ ______
The output stated this:
[[ 1. 1. 2. 3. 4.]
[ 5. 7. 7. 8. 9.]
[ 10. 11. 13. 13. 14.]
[ 15. 16. 17. 19. 19.]
[ 20. 21. 22. 23. 25.]]
Traceback (most recent call last):
File "C:/Python25/Scripts/project2.py", line 15, in <module>
inv_a = inverse(a)
NameError: name 'inverse' is not defined
_______________ _______________ _______________ ____
Why 'inverse' doesn't defined?Comment
Comment