Re: How to do symbolic matrix manipulations
- To: mathgroup at smc.vnet.net
- Subject: [mg92298] Re: How to do symbolic matrix manipulations
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sat, 27 Sep 2008 06:48:40 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <gbjmam$3ab$1@smc.vnet.net>
Peng Yu wrote: > Suppose I have matrices a and b, which does not have any value yet. Beware that Mathematica is not a strongly-type language and things like vector or matrix do not exist per se. A vector can be represented by a one dimensional list holding appropriate element, a matrix by a two dimensional list; but a generic type vector or matrix does not exist natively. > If I write b * a, mathematica would give me "a b". I'm wondering how to make > it know that a and b are matrices, so that it would give me "b a" rather > than "a b". You could use the non-commutative multiplication operator **. In[213]:= b ** a Out[213]= b ** a If you are going to do extensive symbolic manipulation withe generic objects, you may want to define your own matrix type (say expression with head matrix, i.g. something like matrix[a]) and associate/(re)define properties and operator. Regards, -- Jean-Marc