필터 지우기
필터 지우기

Need Help Plotting y=1-e^{-5x}

조회 수: 4 (최근 30일)
Max Ellinthorpe
Max Ellinthorpe 2022년 9월 2일
댓글: Max Ellinthorpe 2022년 9월 2일
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

채택된 답변

Chunru
Chunru 2022년 9월 2일
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
Max Ellinthorpe
Max Ellinthorpe 2022년 9월 2일
If I understand correctly, I have to calcualte 0.2 so that the x-intercept wil roughly be zero?
Max
Max Ellinthorpe
Max Ellinthorpe 2022년 9월 2일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by