MathGroup Archive 2003

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

Search the Archive

Variable number of intervals

  • To: mathgroup at smc.vnet.net
  • Subject: [mg40437] Variable number of intervals
  • From: vnagornyi at netscape.net (Vadim Nagornyi)
  • Date: Sat, 5 Apr 2003 04:00:25 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello,
here is the function that grows on unit interval in 12 steps:

n=12;
Map[(g[x_]:=#/n/;(#-1)/n<=x<=#/n)&,Range[n]];
Plot[g[x], {x,0,1}]

Now, changing n in the first line we can get different number of
steps.
Instead, I would like to make n the function parameter: g[x_,n_] and
define it when plotting, like

Plot[{g[x,3],g[x,7],g[x,12]}, {x,0,1}]

How to to this?
Thanks.
Vadim.


  • Prev by Date: Re: Parallel Kit Question: ParallelDot is much more slow than Dot
  • Next by Date: Super-Increasing List
  • Previous by thread: Re: ImageRotate
  • Next by thread: Re: Variable number of intervals