How can I make a square wave plot with discontinuity points?
Ältere Kommentare anzeigen
like this:

1 Kommentar
Antworten (1)
David Goodmanson
am 20 Mär. 2018
Hi Adrian,
If you can create a variable that contains exactly multiples of 180 as a function of the time array, then it's practically automatic:
T = 10 % the period
t = (0:2000)/50;
y = sign(sind(360*t/T)); % or cosd
plot(t,y,'o-')
1 Kommentar
mathgeek314159
am 16 Apr. 2023
Fabulously simple! After hours of searching and errors in MATLAB, this is exactly what I needed. Thank you!
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!