MathGroup Archive 2004

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

Search the Archive

Fold and FoldList Problems


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: Draw a specific contour curve in dashed line
  • Next by Date: Symbolic matrix algebra
  • Previous by thread: Re: convert notebook into batch file
  • Next by thread: Re: Fold and FoldList Problems