Solve the differential equation

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 6 月 18 日
編集済み: Ameer Hamza 2020 年 6 月 18 日

1 投票

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

カテゴリ

質問済み:

2020 年 6 月 18 日

編集済み:

2020 年 6 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by