How to use sinc function in a piecewise operation

조회 수: 2 (최근 30일)
Reindorf Addo
Reindorf Addo 2020년 4월 11일
댓글: Reindorf Addo 2020년 4월 12일
I am getting an error that reads, "Check for missing argument or incorrect argument data type in call to function 'sinc' ". I am trying to implement this piecewise function, when and 0 otherwise. This is what I am doing,
t = 0: 0.0001: 0.1;
m = (sinc(100*t))*(abs(t) <= to);

채택된 답변

David Hill
David Hill 2020년 4월 12일
t = -.1: 0.0001: 0.1;
t0=.09;
m = (sinc(100*t)).*(abs(t) <= t0);
plot(t,m);
  댓글 수: 5
David Hill
David Hill 2020년 4월 12일
Do you have the Signal Processing Toolbox? If not, you will have to program sinc.
t = -.1: 0.0001: 0.1;
t=t(t~=0);
t0=.09;
m = (sin(pi*100*t))./(pi*100*t).*(abs(t) <= t0);
plot(t,m);
Reindorf Addo
Reindorf Addo 2020년 4월 12일
Thanks, that seemed to be the problem, it works fine with the Signal Processing Toolbox.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by