Adding 2 matrix and Multiplying 2 matrix in python by using scipy/numpy?

Up vote 1 down vote favorite share g+ share fb share tw.

I am trying to use scipy and numpy to perform matrix addition and multiplication. I have 2 matrix "a" and "b". My goal is to add "a" and "b" together and store the result into a matrix "c" Also I want to multiply "a" and "b" and store into a matrix "d".

Are there any function perform like that in Scipy/Numpy? Thanks a lot. Python math matrix numpy scipy link|improve this question asked May 23 '11 at 2:53LearnMore2377 97% accept rate.

– LearnMore May 23 '11 at 3:03 Yes. Check it out in a console and see for yourself. If you could give me some example data and what result you expect I could tell you which operation you want.

– sverre May 23 '11 at 3:04 I am doing image processing in python, a method called Pyramid Based Data Fusion Scheme. I have one question: Is there only one way to do addition of two matrix? – LearnMore May 23 '11 at 3:10 4 Numpy for Matlab Users (scipy.org/NumPy_for_Matlab_Users) has a nice summary of numpy ndarray and matrix operations.

Element-wise operations, broadcasting, matrix operations, etc. – matt May 23 '11 at 5:03.

Matrix multiplication: a = numpy. Matrix(a) be = numpy. Matrix(b) c = a+b d = a*b Array multiplication (map operator.

Mul): a = numpy. Array(a) be = numpy. Array(b) c = a+b d = a*b.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions