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일

0 개 추천

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일

0 개 추천

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

카테고리

태그

질문:

2011년 9월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by