Solve the differential equation
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
y''-5*y'+6y=e^(-x)
0 commentaires
Réponses (1)
Ameer Hamza
le 18 Juin 2020
Modifié(e) : Ameer Hamza
le 18 Juin 2020
xspan = [0 5];
ic = [1; 0]; % initial condition
[t, y_sol] = ode45(@odeFun, xspan, ic);
plot(t, y_sol);
legend({'y', 'dot\_y'});
function dydx = odeFun(x, y)
dydx = [y(2);
5*y(2)-6*y(1)+exp(-x)];
end
0 commentaires
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!