Plot Problem

4 ビュー (過去 30 日間)
Rick
Rick 2011 年 9 月 28 日
These commands create the expected plot:
x=.1:.1:4*pi;
y=sin(pi*x)/pi;
plot(x,y)
However, the following commands create a horizontal line at zero:
x=.1:.1:4*pi;
y=(sin(pi*x))/(pi*x);
plot(x,y)
(I don't have a sinc function.) I don't understand why the second set of commands doesn't work. Thoughts?

採用された回答

Walter Roberson
Walter Roberson 2011 年 9 月 28 日
You are using mrdivide when you want to use rdivide
  1 件のコメント
Rick
Rick 2011 年 9 月 28 日
y=(sin(pi*x))./(pi*x); gives expected plot. Thanks.

サインインしてコメントする。

その他の回答 (1 件)

Raviteja
Raviteja 2011 年 9 月 28 日
x=.1:.1:4*pi;
y=(sin(pi*x))./(pi*x);
plot(x,y)
Is this working?

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by