More obscurely, substpart("[",p,0);
But you should first make sure that length is
not 0, and the leading operator is +.
So maybe, if
f[p]:= if length(p)=0 then [p] else
if part(p,0)="+" then etc.
You may also wish to make sure that the polynomial is expanded,
so you might want to do p:ratexpand(p). In case p=(x+1)*(x-1).
Enjoy maxima.
RJF
Frank Thieme wrote:
> On Sam, 2004-12-18 at 22:11 +0100, Frank Thieme wrote:
>
>>I need to make a list from a polynom
>>
>>x^2+5*x should become [x^2, 5*x]
>>
>>How can I do that in maxima?
>
>
> Ha, found something myself:
>
> makelist(part(p,i),i,1,length(p));
>
> with p as the polynom
>
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima