hello paul,
> I am using maxima to program a simple physic model.
> Let's imagine that at some point of my program, I get a matrix like :
>
> U:MATRIX([U1x],[U1y],[U2x],[U2y])
>
> and an other one like
>
> Fm:MATRIX([SIN(x)],[COS(x)],[SIN(x)^2],[ATAN(x)])
>
> I am looking for a way to assign Fm elements to U elements,
> element-per-elements.
> I mean that at the end of the process, typing U1y; should return cos(x)
> for exemple, or U2x; should return sin(x)^2.
i find that this seems to do it:
matrixmap (lambda ([a, b], a :: b), U, Fm);
(1) matrixmap -- apply some function to elements of a matrix,
see also map, apply, and lambda
(2) "::" operator evaluates its left hand side,
in this case we want to assign to whatever U[k] contains,
not assign to U[k] itself
there is documentation at http://maxima.sf.net/docs.shtml.
hope this helps,
robert dodier