필터 지우기
필터 지우기

How to draw 2D periodic triangular signal

조회 수: 1 (최근 30일)
praveen rai
praveen rai 2017년 8월 22일
댓글: Image Analyst 2017년 8월 22일
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??

채택된 답변

Image Analyst
Image Analyst 2017년 8월 22일
Not yet. That is just one period, not a waveform with multiple periods. Use repmat() to make more of them.
  댓글 수: 2
praveen rai
praveen rai 2017년 8월 22일
can u rewrite this code using repmat function
Image Analyst
Image Analyst 2017년 8월 22일
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;

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Waveform Generation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by