How to define simultaneous equations for ODE45

1 vue (au cours des 30 derniers jours)
alpedhuez
alpedhuez le 30 Mai 2020
Commenté : alpedhuez le 30 Mai 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.

Réponse acceptée

madhan ravi
madhan ravi le 30 Mai 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)]
  1 commentaire
alpedhuez
alpedhuez le 30 Mai 2020
Thank you. Let me work on it.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Tags

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by