how do i plot a sawtooth graph without using the sawtooth function?
Afficher commentaires plus anciens
T = 10*(1/50);
Fs = 1000;
dt = 1/Fs;
t = 0:dt:T-dt;
x = sawtooth(2*pi*50*t);
plot(t,x)
grid on
Réponses (3)
Raj
le 6 Mai 2019
0 votes
See the accepted answer here:
You have to define a high value for parameter 'n' in the code.
Vedika Shinde
le 27 Jan 2021
0 votes
i) Write a set of MATLAB commands for approximating the continuous-time periodic Sawtooth wave of amplitude 5 volts, fundamental frequency 20Hz,and duty cycle 0.5. Plot five cycles of this waveform. ii) Find out the fourier series of this waveform plotted in (i). (iii) Plot the equation of Fourier series to get the original waveform back.
1 commentaire
Atharva Deshpande
le 4 Fév 2021
if u got any stuff related to the above question please do share
Matthias SImons
le 21 Avr 2021
I stumbled over this question and generated an own solution:
To generate a sawtooth with time period T, over a time signal t just use interp1:
xx = [0 T/2 T];
yy = [1 0 1];
y = interp1(xx, yy, mod(t, T));
Catégories
En savoir plus sur Waveform Generation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!