On Thu, 2006-03-09 at 20:56 +0100, laurent couraud wrote:
> > It is possible to extract the matrix elements and construct
> > the equations by writing a little program; maybe there is
> > a command to do this.
> >
>
> COEFMATRIX ([eq1, ...], [var1, ...])
coefmatrix does the opposite of what was needed.
"Extract the matrix elements and construct the equations"
in this case meant going from:
eqn: matrix([x],[y]) = matrix([1],[2]);
to:
[x=1, y=2]
which can be done with:
makelist(lhs(eq)[i][1] = rhs(eq)[i][1], i, 1, length(lhs(eq)));
By the way, I just noticed the documentation of coefmatrix is wrong:
-- Function: coefmatrix ([<eqn_1>, ..., <eqn_m>], [<x_1>, ..., <x_n>])
Returns the coefficient matrix for the variables <eqn_1>, ...,
<eqn_m> of the system of linear equations <x_1>, ..., <x_n>.
Does any developer have any objection if I change it to:
-- Function: coefmatrix ([<eqn_1>, ..., <eqn_m>], [<x_1>, ..., <x_n>])
Returns the coefficient matrix for the variables <x_1>, ...,
<x_n> of the system of linear equations <eqn_1>, ..., <eqn_m>.
?
I guess for simple changes like this I just commit a a new version of
doc/info/Matrices.texi; is that enough, or should I do something else?
Jaime