15 May 17:26
Re: apply(+,...), reduce, sum, ...
From: Joachim De Beule <joachim <at> arti.vub.ac.be>
Subject: Re: apply(+,...), reduce, sum, ...
Newsgroups: gmane.comp.mathematics.maxima.general
Date: 2008-05-15 15:26:13 GMT
Subject: Re: apply(+,...), reduce, sum, ...
Newsgroups: gmane.comp.mathematics.maxima.general
Date: 2008-05-15 15:26:13 GMT
Great! Thanks. You may forget my previous mail...
On Thursday 15 May 2008 17:23:42 Barton Willis wrote:
> -----maxima-bounces <at> math.utexas.edu wrote: -----
>
> >For example, how do convert a list to a sum, like from [a,b,c] to a+b+c?
>
> (%i5) apply("+",[a,b,c]);
> (%o5) c+b+a
>
> Instead of apply, you can use xreduce, rreduce, lreduce, or tree_reduce
> (see user documentation). The same quote trick works for apply("*",
> [a,b,c])
> and apply("^", [x,5]).
>
> Barton
RSS Feed