How to Plot Piecewise Functions in MATLAB?

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
sofy
Messages
1
Reaction score
0
Hello!

I want to plot this function on MATLAB:

f(t)=1 si 0<=t<=1
f(t)=0 otherwise

Please help me! How to do it?
I tried so much things it doesn't work!
 
Physics news on Phys.org
sofy said:
Hello!

I want to plot this function on MATLAB:

f(t)=1 si 0<=t<=1
f(t)=0 otherwise

Please help me! How to do it?
I tried so much things it doesn't work!

Look up the Heaviside function in the Matlab documentation.