First time here? Check out the FAQ!
answered 10 years ago
Here are two other options:
1) Use the Heaviside function:
f(x)=heaviside(x-1)-heaviside(x-3) plot(f(x),(x,0,5))
2) define a Python function
def f(x,a,b): if x>a and x<b: return(1) else: return(0) plot(lambda x: f(x,1,3),(x,-3,5))