Dear List,
I have written in Matlab a very useful mydisplay() function which takes a
variable number of arguments, and prints out the names of the arguments
passed to it as well as their values - see sample output below.
In the case of symbolic matrices it encloses each row within [ ... ] - note
the space at the beginning and end.
I want to write the same function in Maxima but do not know how to do this.
Any assistance in Maxima or lisp would be appreciated.
Thanks very much.
Kind regards,
C. Frangos.
>> mydisplay(a1,a2,a3,a4)
a1 =
[ sin(x1)+x2^2, cos(x3)+tan(x1) ]
[ exp(x1)+2*x3^5, x2^3+x1^2 ]
a2 = sin(x2)^2
a3 =
[ (sin(x1)+x2^2)^2+(cos(x3)+tan(x1))*(exp(x1)+2*x3^5),
(sin(x1)+x2^2)*(cos(x3)+tan(x1))+(cos(x3)+tan(x1))*(x2^3+x1^2) ]
[ (exp(x1)+2*x3^5)*(sin(x1)+x2^2)+(x2^3+x1^2)*(exp(x1)+2*x3^5),
(cos(x3)+tan(x1))*(exp(x1)+2*x3^5)+(x2^3+x1^2)^2 ]
a4 = cos(x1)^2+sin(x2)^2+tan(x3)^2
>>
>> mydisplay(a1,a4)
a1 =
[ sin(x1)+x2^2, cos(x3)+tan(x1) ]
[ exp(x1)+2*x3^5, x2^3+x1^2 ]
a4 = cos(x1)^2+sin(x2)^2+tan(x3)^2
>>