フィルターのクリア

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

32 ビュー (過去 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 件のコメント
Jos (10584)
Jos (10584) 2019 年 4 月 4 日
編集済み: Jos (10584) 2019 年 4 月 4 日
Did you check what [y(interval(1)) y(interval(2))] returns? Do you think this is a valid Y limit?

サインインしてコメントする。

回答 (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 件のコメント
Alex Mcaulley
Alex Mcaulley 2019 年 4 月 4 日
This code works, clear your workspace and run the above code
Alex Mcaulley
Alex Mcaulley 2019 年 4 月 4 日
If not, what is the error you are getting?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by