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)

 Risposta accettata

Sindar
Sindar il 27 Ott 2020
x=[-2:0.1:2];
y = exp(-x)-x;
plot(x,y)

Più risposte (0)

Categorie

Scopri di più su Data Import and Analysis in Centro assistenza e File Exchange

Tag

Richiesto:

N/A
il 27 Ott 2020

Commentato:

N/A
il 27 Ott 2020

Community Treasure Hunt

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

Start Hunting!

Translated by