What features should I use to plot these charts?

11 views (last 30 days)

Accepted Answer

Cam Salzberger
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
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.
Dani Focaru
Dani Focaru on 18 Oct 2017
I get it! Will also think about your version. Thank you for your patience !

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!