plotting a function correctly

1 Ansicht (letzte 30 Tage)
N/A
N/A am 27 Okt. 2020
Kommentiert: N/A am 27 Okt. 2020
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)

Akzeptierte Antwort

Sindar
Sindar am 27 Okt. 2020
x=[-2:0.1:2];
y = exp(-x)-x;
plot(x,y)

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by