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.
- Follow-Ups:
- Re: Variable number of intervals
- From: Dr Bob <majort@cox-internet.com>
- Re: Variable number of intervals