MATLAB Answers

How to define simultaneous equations for ODE45

1 view (last 30 days)
alpedhuez
alpedhuez on 30 May 2020
Commented: alpedhuez on 30 May 2020
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.

  0 Comments

Sign in to comment.

Accepted Answer

madhan ravi
madhan ravi on 30 May 2020
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)]

More Answers (0)

Tags

Products


Release

R2020a

Translated by