MathGroup Archive 2002

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

Search the Archive

Re: List argument

  • To: mathgroup at smc.vnet.net
  • Subject: [mg36393] Re: List argument
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 4 Sep 2002 21:22:03 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <al4aqb$rc1$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

Plot[
Evaluate[
  Table[eq, {m, -30, 29}]
  ],{x, -50, 50}
]

Plot[] has the attribute HoldAll and if you don't evaluate it,
it can't find out, that a list of expressions 
should be plotted instead of a single expression.

*And* you should avoid For[] loops. You don't need explicit
loops in Mathematica.

Regards
  Jens

CeZaR wrote:
> 
> Hi,
> 
> I want to do these operations:
> 
> eq = m x^2 + 2(m + 1)x + m + 2
> l = {}
> For[i = -30, i < 30, i++, AppendTo[l, eq /. m -> i]]
> Plot[l, {x, -50, 50}]
> 
> but i get this error:
> l is not a machine-size real number at x = -49.99999583333334
> 
> Can someone exaplain to me what i am doing wrong here??
> 
> Thanks!
> 
> CeZaR


  • Prev by Date: Re: Generating Two Unit Orthogonal Vectors to a 3D Vector
  • Next by Date: Re: List argument
  • Previous by thread: Re: List argument
  • Next by thread: Re: List argument