Value must be a 1x2 vector of numeric type in which the second element is larger than the first and may be inf

22 次查看(过去 30 天)
I do not understand why the plot don't work in this interval!!!!
interval=[0 10];
x=0:0.1:10;
y=@(x) 1/x;
set(gca, 'XLim', interval, 'YLim', [y(interval(1)) y(interval(2))] );

回答(1 个)

Alex Mcaulley
Alex Mcaulley 2019-4-4
编辑:Alex Mcaulley 2019-4-4
Use fplot:
interval=[0 10];
y=@(x) 1/x;
fplot(y,interval)
  3 个评论

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by