[ODE] How to use ODE in Matlab Simulink?

Tang, Dacheng dacheng.tang at lmco.com
Thu Apr 19 08:48:54 MST 2007

Yes you can.  You have to compile it as part of an S-Function.  Once you
know how to work with S-Funcitons the ODE part is pretty standard.  Here
are some issues you might run into.
1.  The LCC compiler that comes with MATLAB/Simulink only compiles C.
You will have to setup a C++ compiler.You can run mex -setup to choose
from available compilers on yoru system.  The MATLAB/Simluink
documentation lists supported compilers for your software version.
2.  The S-Function terminates/exits after every time step, so you will
have to pass a pointer containing all of your data off to MATLAB and
then get it back at the next time step (one huge object in my case).  If
you're allocating memory then make sure you allocate and free at the
right times.
3.  If you have a memory leak in your code MATLAB will not terminate
properly.  It will close but stay in the task manager.  This is actually
pretty nice since it helps me to catch bugs.
I was able to get everything up and running by reading the
MATLAB/Simulink documentation.  They're not the best docs in the world
but the information is there.


From: duan feng [mailto:dfrobot at yahoo.co.jp] 
Sent: Wednesday, April 18, 2007 5:23 AM
To: ode at ode.org
Subject: [ODE] How to use ODE in Matlab Simulink?

Dear All,
    Can ODE be used in Matlab Simulink? How to realize it? Thank you
very much.
Best regards,
    Feng DUAN


Big Chance to Win 50,000 Yahoo! Points!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ode.org/pipermail/ode/attachments/20070419/51ea7a05/attachment-0001.htm

More information about the ODE mailing list