Re: Matrix multiplication problem fixed via dot operation.
- To: mathgroup at smc.vnet.net
- Subject: [mg64585] Re: [mg64552] Matrix multiplication problem fixed via dot operation.
- From: Kristjan Kannike <kkannike at physic.ut.ee>
- Date: Thu, 23 Feb 2006 00:34:28 -0500 (EST)
- References: <200602221058.FAA23462@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On Wed, 22 Feb 2006, Chris Young wrote: > To answer my own posting, it looks like the "dot" operator is needed > when the matrices aren't both square. > > E.g.: a row vector with components a and b times a column vector with > components c and d will yield the correct result, the dot-product. > > I'm still puzzled why Mathematica doesn't do the same thing without the dot. > > Chris Young Beware: though you got no error messages in case of multiplying square matrices with a space between them (as opposed to a dot), the result is NOT a dot product (matrix multiplication), but the matrices are multiplied element by element, e.g. if C = A B then C[[1,1]] equals A[[1,1]] * B[[1,1]], etc. In short, the ordinary multiplication has the attribute Listable. (It can be very useful, e.g. when you have a vector variable x and a vector (list) of coefficients a, to compose them into a x.) Kristjan Kannike <http://www.physic.ut.ee/~kkannike/english/> The same person at different times can seem like a different person; sometimes that person is you. -- Peter Norvig
- References:
- Matrix multiplication problem fixed via dot operation.
- From: Chris Young <c1572young@earthlink.net>
- Matrix multiplication problem fixed via dot operation.