sinc function
2 次查看(过去 30 天)
显示 更早的评论
At y=0, the graph is not plotted. How would I plot it, to compare to the sinc(x) function. Thanks in advanced.
x=-20:0.1:20;
y=(sin(pi*x))/(pi*x);
if x=0
.....
end
plot(x,y,);
hold on
plot (x,sinc(x),'*');
0 个评论
采纳的回答
Matt Fig
2011-4-15
x = -20:0.0001:20;
y = (sin(pi*x))./(pi*x);
y(x==0) = 1;% If you don't get: (Warning: Divide by zero.) you missed 0.
plot(x,y)
更多回答(1 个)
Walter Roberson
2011-4-15
The value is undefined at that location. What are you hoping to have plotted there?
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!