plotting a function correctly

1 次查看(过去 30 天)
N/A
N/A 2020-10-27
评论: N/A 2020-10-27
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
x=[-2:0.1:2];
y = exp(-x)-x;
plot(x,y)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import and Analysis 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by