MathGroup Archive 2008

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

Search the Archive

Re: Controlling the order of evaluations

anguzman at wrote:


> So, what I always end up trying is something like:
> Plot[f[x,#]&/@{y1,y2,....,yn},{x,a,b}]
> Mathematica (5.2 Version for Windows) complains but finally interprets 
> correctly what I meant and does the plot correctly (sometimes)with all 
> the curves , but this errors are annoying. They are always of the form:
> \" bla bla.. f[x,y1] is not numerical at ....\"



   f[x_?NumericQ, y_?NumericQ] := NIntegrate[2^(s*x), {s, 0, y}]

   Plot[Evaluate[f[x, #] & /@ {2, 3, 4, 5}], {x, 0.5, 1.5}]

See the FAQ "How do I write a function which evaluates only when the 
argument is a number?" at

-- Jean-Marc

  • Prev by Date: Re: How does Mathematica know whether a number is real or complex?
  • Next by Date: Re: Expressions with ellipsis (...)
  • Previous by thread: Controlling the order of evaluations
  • Next by thread: Re: Controlling the order of evaluations