I am trying to plot y=1-e^{-5x}. but matlab keeps spitting out the wrong plot. Please let me know what I am doing wrong.
My Code:
>> syms x y
>> y = 1-(exp(-5*x));
>> fplot(y)
The plot is supposed to look like this

 Akzeptierte Antwort

Chunru
Chunru am 2 Sep. 2022

0 Stimmen

syms x y
y = 1-(exp(-5*x));
fplot(y, [-.2 3]) % need right interval for x (or set ylim([-2 1])
grid on

3 Kommentare

Max Ellinthorpe
Max Ellinthorpe am 2 Sep. 2022
Thank you!
Max Ellinthorpe
Max Ellinthorpe am 2 Sep. 2022
If I understand correctly, I have to calcualte 0.2 so that the x-intercept wil roughly be zero?
Max
Max Ellinthorpe
Max Ellinthorpe am 2 Sep. 2022
From my understanding, I can set my ylim to anything and my code will now return a correct graph. My interval set points have to be exactly correct otherwise my graph will shift along the x-axis.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Mathematics finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by