Ordinary Differential Equations (ODEs)

조회 수: 7 (최근 30일)
Kutlu Yigitturk
Kutlu Yigitturk 2021년 4월 20일
댓글: Star Strider 2021년 4월 20일
syms t y(t)
ysol=dsolve(' D2y + Dy + 4.25*y = 0','y(0)=2','Dy(0)=1');
y(t)=simplify(ysol)
ezplot(y(t),[0 10]);
xlabel('t');
ylabel('y(t)');
Based on the code block above, I get the following output.
But the output I want to get is as follows.
The formula is as above
I have to use ezplot. How can I get the 2nd output? Where am I making a mistake?

채택된 답변

Star Strider
Star Strider 2021년 4월 20일
Change the ezplot call to fplot:
syms t y(t)
ysol=dsolve(' D2y + Dy + 4.25*y = 0','y(0)=2','Dy(0)=1');
Warning: Support of character vectors and strings will be removed in a future release. Use sym objects to define differential equations instead.
y(t)=simplify(ysol)
y(t) = 
fplot(y(t),[0 10]);
xlabel('t');
ylabel('y(t)');
grid
And note the Warning.
  댓글 수: 4
Kutlu Yigitturk
Kutlu Yigitturk 2021년 4월 20일
Thank you.
Star Strider
Star Strider 2021년 4월 20일
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Particle & Nuclear Physics에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by