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 Kommentar

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

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

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
.

Weitere Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox 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