can anyone program the solution and graph for this function

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 11 月 29 日
編集済み: Ameer Hamza 2020 年 11 月 29 日

0 投票

See ode45(): https://www.mathworks.com/help/matlab/ref/ode45.html espically see the example titled "Solve Nonstiff Equation".
For example
dydt = @(t, y) [y(2);
-2*y(2)+3*y(1)];
tspan = [0 10];
IC = [1; 0];
[t, y] = ode45(dydt, tspan, IC);
plot(t, y);
legend({'$y$', '$\dot{y}$'}, 'FontSize', 16, 'Location', 'best', 'Interpreter', 'latex')

カテゴリ

タグ

質問済み:

2020 年 11 月 29 日

編集済み:

2020 年 11 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by