MathGroup Archive 1999

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

Search the Archive

Re: Plot[] problem (plnr) - help !!!

  • To: mathgroup at
  • Subject: [mg15997] Re: [mg15935] Plot[] problem (plnr) - help !!!
  • From: BobHanlon at
  • Date: Fri, 19 Feb 1999 03:27:10 -0500
  • Sender: owner-wri-mathgroup at

In a message dated 2/18/99 2:21:20 PM, root at writes:

>I'm trying to do most trivial and simple thing - define 
>some function and then Plot[] it. However, I get some very
>weird error - " not a machine-size real number at ..."
>Here is the code :
>H[w] == 20Log[10,Sum[a[k] Exp[I 2Pi w(-k)], {k,0,1}]]
>Plot[H[w], {w, 1, 100}]
>I've seen some articles (even at about that
>problem, but NONE of them proposed a working solution !!!
>Just putting Evaluate[] inside the Plot[] does nothing...

H[w_] := 20Log[10,Sum[a[k] Exp[I 2Pi w(-k)], {k,0,1}]];

Once you clean up the syntax and avoid deleting the definition of H 
before the Plot command, you still have the problem that your 
function is, in general, complex.  For example, 

Table[{w, H[w]}, {w,1,1.5, .1}]//ColumnForm

You can either plot its real part:

Plot[Re[H[w]], {w, 1, 100}];

plot its absolute value:

Plot[Abs[H[w]], {w, 1, 100}];

or, plot its value at integer values of w:

ListPlot[Table[H[w], {w, 1, 100}]];

Bob Hanlon

  • Prev by Date: Re: MyPrependTo
  • Next by Date: Re: Pure Functions in rules
  • Previous by thread: Plot[] problem (plnr) - help !!!
  • Next by thread: Re: Plot[] problem (plnr) - help !!!