Try setting the option variable scalarmatrixp to false; for example:
(%i2) matrix([1,2]) . matrix([x],[y]);
(%o2) 2*y+x
(%i3) scalarmatrixp : false;
(%o3) false
(%i4) matrix([1,2]) . matrix([x],[y]);
(%o4) matrix([2*y+x])
(%i5) matrixp(%);
(%o5) true
To view the user documentation for scalarmatrixp, enter "?? scalarmatrixp".
--Barton
________________________________________
From: maxima-bounces at math.utexas.edu [maxima-bounces at math.utexas.edu] on behalf of Vlad Tepesch [Vlad_Tepesch at gmx.de]
Sent: Thursday, August 30, 2012 13:44
To: maxima at math.utexas.edu
Subject: Maxima Bug?
Hi,
iam a bit confused about matrix mutliplications.
multiplying 2 matrices normally results in a matrix.
But if multiplying a single row matrix with a single column matrix, the result is not a matrix but a scalar.
This leads to problems then further matrix operations are applied to the result of the above mentioned oparation.
T: genmatrix(t,2,2);
S: genmatrix(s,2,2);
T.S;
invert(T.S);
works.
T: genmatrix(t,1,2);
S: genmatrix(s,2,1);
T.S;
invert(T.S);
does not.
I stumbled about this while trying to implement some generic kalman.
But the script fails depending on input parameters allthough the math normmay is correct.
I think a matrix operation should allways produce a matrix.
Has somebody an idea to work around this in some generic way?
with best regards,
vlad
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima