MathGroup Archive 2002

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

Search the Archive

Re: Stupid newbie question

  • To: mathgroup at
  • Subject: [mg33156] Re: Stupid newbie question
  • From: "Oliver Friedrich" <oliver.friedrich at>
  • Date: Wed, 6 Mar 2002 01:55:31 -0500 (EST)
  • References: <a61ump$goj$>
  • Sender: owner-wri-mathgroup at

Hi Mike,

I know what you want to do with the line {a,b}={-1,1.5} but this assignment
doesn't work. Write your borders directly into your Plot command.
Also, if you define a function like
for example, this expression is a replacement rule. The blank _ acts like a
placeholder for something (a pattern). With x_ you can assign this
"something" the name x. So you can use that something again on the right
hand side of that definition. Two examples

1. You define an assignment like

2. Now Mathematica will evaluate like this
g[2,6] will evaluate to 2+6 will evaluate to 8

g[a,t^2+4] will evaluate to a+4+t^2

You see the way it is done?
So if you define a function with f[x_]=bla bla
and you try to call it in your Plot with Plot[f,{x,a,b}] it won't work,
because an expression f doesn't match the pattern f[x_] so Mathematica won't
apply that replacement rule on f. You must plot with

Plot[f[x],{x,1,2}] that will do. You don't even have to use the x you can
also write Plot[f[mike],{mike,1,2}].



"Mike O'Leary" <Gremmie at> schrieb im Newsbeitrag
news:a61ump$goj$1 at
> I can't seem to get a Plot working.  I have all this typed in the
> Clear[a, b, f]
> f[x_] := 1 - (Cos(\[ExponentialE]^(3x/4)))
> {a, b} = {-1, 1.5}
> Plot [f, {x, a, b}]
> I keep getting an error saying f is not a machine-size real number at x
> = -1.  Any help is appreciated.  Thanks.

  • Prev by Date: Re: How to transform x axis on ListPlot?
  • Next by Date: Re: Quadratic non-linear ODE.
  • Previous by thread: Re: Stupid newbie question
  • Next by thread: Re: Stupid newbie question