How to Plot Piecewise Functions in MATLAB?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
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.