S-functions with ode45 in Matlab
Mostra commenti meno recenti
Hi, all! I have a dynamical system written in an S-function and I want to simulate it in a Matlab loop. I use ode45 on the S-function and it seems to work (it runs with no errors). However it's not the result I was expecting. After that, I took the code from the S-function and plugged into a regular dx = f(t,x,u) function and when I applied ode45 to f, I got what I was looking for.
So, my question: what's wrong with applying ode45 to an S-function?
Risposta accettata
Più risposte (1)
Arnaud Miege
il 28 Giu 2011
0 voti
You don't need to "apply" ode45 to an S-function since Simulink has its own solver. See Writing S-Functions in MATLAB in the documentation.
HTH,
Arnaud
1 Commento
Gigi Dioda
il 28 Giu 2011
Categorie
Scopri di più su Create MATLAB S-Functions in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!