Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Defining a staircase function' topicStudent Support Forum > General > "Defining a staircase function"

Next Comment >Help | Reply To Topic
Author Comment/Response
Bianca Nelson
04/07/00 7:34pm

I'd like to be able to define a sort of ''staircase'' function, which I would write as the following (forgive the bad ASCII, please!):

---
| 0 if z<0
| 1 if 0<z<d1
| 2 if d1<z<d2
| 3 if d2<z<d3
F[z_]= < .
| .
| .
| p if d(p-1)<z<dp
| p+1 if dp<z
___

Where the ''d''s are pre-defined, and the value of p (the total number of steps) is changeable, with a value anywhere from 2 to several hundred. I would like to be able to find
F[z] for any random z, and for example be able to plot F[z] vs. z. Also, I need to use F[z] in the definition of other functions that depend on z.

I know that if p is very small (say, 3), I could just use a few nested ''if'' statements. But I would like to be able to readily change the number of steps, and make it quite large. Unfortunately, I am not too familiar with functions much more complicated than, for example, the nested ''if'' statement. And help would be appreciated!!

Thanks,
Bianca

URL: ,

Subject (listing for 'Defining a staircase function')
Author Date Posted
Defining a staircase function Bianca Nelson 04/07/00 7:34pm
Re: Defining a staircase function Fabrice P. L... 04/10/00 4:06pm
Re: Defining a staircase function Randy Silvers 04/12/00 05:30am
Re: Defining a staircase function Conor 04/25/00 4:55pm
Next Comment >Help | Reply To Topic