How to draw 2D periodic triangular signal
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
praveen rai
am 22 Aug. 2017
Kommentiert: Image Analyst
am 22 Aug. 2017
w=1; % signal width
Amp=1; % signal amplitude
tt=-w:w;
y1=Amp-Amp*abs(tt)/w;
figure;
plot(tt,y1)
is this is code is right??
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 22 Aug. 2017
Not yet. That is just one period, not a waveform with multiple periods. Use repmat() to make more of them.
2 Kommentare
Image Analyst
am 22 Aug. 2017
Try this:
w=1; % signal width
Amp=1; % signal amplitude
tt=-w:w;
y1=Amp-Amp*abs(tt)/w;
% Replicate this one period 7 times.
tt = -1 : (1 + 6 * length(y1));
y1 = repmat(y1, [1, 7]);
plot(tt, y1, 'LineWidth', 2)
grid on;
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Waveform Generation 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!