plotting a function correctly

f(x)= exp(-x)-x
The x intercept is between 0 and 1 on other graphing software, yet mat lab incorrectly puts the x intercept after 2. Please correct my code.
x=[-2:0.1:2];
y = exp(-x)-x;
plot(x,y)

 採用された回答

Sindar
Sindar 2020 年 10 月 27 日

0 投票

x=[-2:0.1:2];
y = exp(-x)-x;
plot(x,y)

1 件のコメント

N/A
N/A 2020 年 10 月 27 日
Thank you. lol

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Import and Analysis についてさらに検索

タグ

質問済み:

N/A
2020 年 10 月 27 日

コメント済み:

N/A
2020 年 10 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by