Re: Plot[] problem (plnr) - help !!!
- To: mathgroup at smc.vnet.net
- Subject: [mg15997] Re: [mg15935] Plot[] problem (plnr) - help !!!
- From: BobHanlon at aol.com
- Date: Fri, 19 Feb 1999 03:27:10 -0500
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 2/18/99 2:21:20 PM, root at borjch.math.tau.ac.il 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 - " ...is not a machine-size real number at ..." > >Here is the code : >a[0]==1 >a[1]==0.99/50000 >H[w] == 20Log[10,Sum[a[k] Exp[I 2Pi w(-k)], {k,0,1}]] >Clear[H] >Plot[H[w], {w, 1, 100}] > >I've seen some articles (even at www.wolfram.com) about that >problem, but NONE of them proposed a working solution !!! > >Just putting Evaluate[] inside the Plot[] does nothing... > a[0]=1; a[1]=0.99/50000; 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