Solve the differential equation
Mostrar comentarios más antiguos
y''-5*y'+6y=e^(-x)
Respuestas (1)
Ameer Hamza
el 18 de Jun. de 2020
Editada: Ameer Hamza
el 18 de Jun. de 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
Categorías
Más información sobre Ordinary Differential Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!