Numerical Python Question

josegomez at gmx.net josegomez at gmx.net
Tue Dec 4 09:01:33 EST 2001


Uwe Schmitt <uwe at rocksport.de> wrote:
> As hilb is a n x n matrix and x is n x 1 the result b should be n x 1.
> But the program outputs a n x n matrix !!!

	The way I understand it is that you need to have a matrix
multiplication (which is different to a 2D array multiplication). For
this you need matrixmultiply. An example from the manual:


>>> print a 

[[0 1 2]
[3 4 5]]
>>> print b 
[1 2 3]
>>> print a*b 
[[ 0 2 6]
[ 3 8 15]]
>>> print matrixmultiply(a,b) 
[ 8 26]

	Hope this helps
	José

-- 
José L Gómez Dans			PhD student
Tel: +44 114 222 5582			Radar & Communications Group
FAX; +44 870 132 2990			Department of Electronic Engineering
					University of Sheffield UK



More information about the Python-list mailing list