how can I plot a unit step function?
424 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Seba.V
am 22 Aug. 2019
Beantwortet: Ildeberto de los Santos Ruiz
am 19 Jul. 2021
How can i plot a unit step function or a piecewise function in Matlab?
ie:
h(t)=u(t-2)-u(t-4)?
or another example:
h(t)={0 for t<0, 1 for 2<t<3, 0 for t>3
Also, how can i plot a periodic square wave with thresholds in matlab?
2 Kommentare
the cyclist
am 22 Aug. 2019
This sounds like homework. If so, show what you have tried so far, and ask some specific questions where you are stuck. If you have literally no idea where to even begin, I suggest you go back to your teacher and seek help.
Akzeptierte Antwort
Weitere Antworten (1)
Ildeberto de los Santos Ruiz
am 19 Jul. 2021
This is my proposal, I hope it helps you:
u = @(t) double(t>=0);
h = @(t) u(t-2)-u(t-4);
fplot(h,[0,5])
0 Kommentare
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!