필터 지우기
필터 지우기

Problem in plotting a sinc function

조회 수: 2 (최근 30일)
Muhammad Saim Nasir Siddiqui
Muhammad Saim Nasir Siddiqui 2015년 3월 6일
댓글: Star Strider 2015년 3월 8일
when i run this code.. it shows me an error
Error in ==> plotsinc at 2
y = sinc(x);
what that means...
iam using this code ..to plot a basic sinc function
x = linspace(-5,5);
y = sinc(x);
plot(x,y)
  댓글 수: 1
Geoff Hayes
Geoff Hayes 2015년 3월 7일
Muhammad - please post the full error message (so that would be all of the red text that is generated when you run your above code).

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

채택된 답변

Star Strider
Star Strider 2015년 3월 7일
The code you posted runs for me without error.
The sinc function is part of the Signal Processing Toolbox.
If don’t have the Signal Processing Toolbox, you can create your own version of sinc easily enough:
sincx = @(x) sin(pi*x+1E-8)./(pi*x + 1E-8);
x = linspace(-5,5);
y = sincx(x);
plot(x,y)
  댓글 수: 2
Muhammad Saim Nasir Siddiqui
Muhammad Saim Nasir Siddiqui 2015년 3월 8일
Thanks it works
Star Strider
Star Strider 2015년 3월 8일
My pleasure!

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by