How to define simultaneous equations for ODE45

1 次查看(过去 30 天)
Suppose I have equations
I understand I write
f=@(t,x,a)[x(1)+x(2),x(1)-a*x(2)]
But I hope to define equations one by one f1 and f2 and then combine into f. Please advise.

采纳的回答

madhan ravi
madhan ravi 2020-5-30
f1 = @(t,x) x(1) + x(2)
f2 = @(t,x,a) x(1)-a*x(2)
F = @(t,x,a) [f1(t,x);f2(t,x,a)]

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by