フィルターのクリア

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 Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by