MathGroup Archive 2005

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

Search the Archive

Problem using Evaluate[] inside a Plot command. 5.1

  • To: mathgroup at
  • Subject: [mg54019] Problem using Evaluate[] inside a Plot command. 5.1
  • From: Nasser Abbasi <nma at>
  • Date: Mon, 7 Feb 2005 03:13:26 -0500 (EST)
  • Reply-to: nma at
  • Sender: owner-wri-mathgroup at


This is a really strange problem.
Mathematica 5.1, ControlSystems application 2.02 (latest)

Below are 2 simple examples, one works and the
other does not.

Any one can see why?

When I call a function inside Evaluate inside the
plot command it fails. But when I call the function
outside the plot command, then use Evaluate on
the result inside the plot, it works.

Shouldn't these things be the same?

<< ControlSystems`
sys = TransferFunction[s,  1 / (s^2 +  s + 1)];

(* ---- example that works -----*)

y = OutputResponse[sys, UnitStep[t], t] ;
Plot[{t^2 , Evaluate[y]},
      {t, 0, 3},PlotRange -> All]

(*--- example that does not work ----*)

Plot[{t^2, Evaluate[OutputResponse[sys,UnitStep[t], t]]},
      {t, 0, 3}, PlotRange -> All]

(*------ end ------------------------*)

I get the common error messages:

plot::plnr: .... is not a machine-size real
number at t=....

Notice that this does not happen for a function that
I make, see this below. it works.

g[t_] := t^3;
Plot[{ t^2, Evaluate[g[t]]}, {t, 0, 30}]


  • Prev by Date: Re: Finding extra digit
  • Next by Date: Controlling Print[].
  • Previous by thread: DLL in windows, Palettes running procedures silently
  • Next by thread: Re: Problem using Evaluate[] inside a Plot command. 5.1