MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Fold and FoldList Problems


Hi,

you are sure that you not mean

g[x_]:=Plus @@ h[x]

??

Regards

  Jens

GlennRoberts at hbosts.com wrote:
> 
> here is one that might be easy and i am just not getting it - help appriciated - i have written a small function h[x_] say in a .m file that returns a list as its answer - i would like to past this list thou a function in the same .m file that does:
> 
> g[x_]:= Fold[Plus,0,h[x]]
> 
> simple enough i thought but i get a error message returned that tells me the g[x_] function is trying to calcualte on each element of the list h[x] rather than the full list to return the sum - not sure what has gone wrong on this one - thanks - glenn


  • Prev by Date: Re: convert notebook into batch file
  • Next by Date: preserve neighborhood during random reordering
  • Previous by thread: Fold and FoldList Problems
  • Next by thread: Symbolic matrix algebra