syms y(x)
eqn = 2*diff(y,x,3)+9*diff(y,x,2)+12*diff(y,x,1)+5*y == 0;
ySol = dsolve(eqn)
z = eval(vectorize(ySol));
plot(ySol,z)

댓글 수: 1

Before you can plot anything, you must specify three initial conditions.

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

 채택된 답변

The initial conditions are not provided, and it is not possible to plot a function with symbolic (or otherwise undefined) parameters.
Try this —
syms y(x) y0 Dy0 D2y0
Dy = diff(y);
D2y = diff(Dy);
D3y = diff(D2y);
eqn = 2*diff(y,x,3)+9*diff(y,x,2)+12*diff(y,x,1)+5*y == 0;
ySol = dsolve(eqn, y(0)==y0, Dy(0)==Dy0, D2y(0)==D2y0)
ySol = 
ySol = subs(ySol, {y0, Dy0, D2y0},{1,2,3}) % Substitute (Or Initially Supply) Initial Conditions
ySol = 
figure
fplot(ySol, [0 10])
grid
.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

질문:

2021년 5월 21일

답변:

2021년 5월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by