What features should I use to plot these charts?
11 views (last 30 days)
Show older comments
Accepted Answer
Cam Salzberger
on 18 Oct 2017
Hello Dani,
If you have the Signal Processing Toolbox, you can use sawtooth with the "xmax" argument to make the triangle wave, and square to make the square wave.
Once you've generated the signals, you can use a simple plot to display the wave, and axis to set the view range to your desired window.
-Cam
3 Comments
Cam Salzberger
on 18 Oct 2017
Edited: Cam Salzberger
on 18 Oct 2017
Yep, that seems to work. If you wanted to use sawtooth using this example as a guide, this is how you could do it for the first graph:
T = 5*2;
Fs = 100;
dt = 1/Fs;
t = -5:dt:5-dt;
x = sawtooth(2*pi*0.5*t, 0.5);
plot(t, x)
ylim([-4 4])
But your way is probably more readable. The original image did show from -5 to 5 though, not 0 to 10. Not sure how much that matters to you though.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!