How can we plot a function with domain involving infinity
9 次查看(过去 30 天)
显示 更早的评论
How can we plot a function with the domain involving infinity? Suppose I want to plot the following function:
f(y)=(2*pi*y)^(-1/2)*exp(-y/2); y>0
How can I do this in MATLAB?
Thanks
采纳的回答
Andrew Newell
2017-4-19
Of course, you can't plot the whole thing, but you can plot enough so that it's obvious where the curve is going. One approach is to let MATLAB choose the domain for you:
f = @(y) (2*pi*y).^(-1/2).*exp(-y/2);
ezplot(f)
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!