[Numpy-discussion] Translation of a Matlab expresion

Pierre GM pgmdevlist at gmail.com
Mon Apr 9 12:47:36 EDT 2007


On Monday 09 April 2007 06:28:33 Miquel Poch wrote:

> T is a matrix and the rest of the variables are floats. I don't know why
> are this '.' in the expresion, and that's why I can't translate it.

http://www.scipy.org/NumPy_for_Matlab_Users

The .* means: element-wise multiplitcation.

> I tried to do it without the '.' but then the expression it's incorrect. We
> can't multiply two matrix wich number of rows and columns are the same.
>
> ''' exceptions.ValueError : objects are not aligned '''

Use numpy.multiply, or don't use matrices at all, just plain ndarrays.



More information about the NumPy-Discussion mailing list