Filter löschen
Filter löschen

Plot Problem

8 Ansichten (letzte 30 Tage)
Rick
Rick am 28 Sep. 2011
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?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 28 Sep. 2011
You are using mrdivide when you want to use rdivide
  1 Kommentar
Rick
Rick am 28 Sep. 2011
y=(sin(pi*x))./(pi*x); gives expected plot. Thanks.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Raviteja
Raviteja am 28 Sep. 2011
x=.1:.1:4*pi;
y=(sin(pi*x))./(pi*x);
plot(x,y)
Is this working?

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by