How do I simulate simulink model using the ode45.m function at the command prompt or in an m file?
52 views (last 30 days)
Show older comments
I need to run simulink model using the matlab function ode45.m, and I don't know how to do this as even with a simple first order system in simulink 1/(s+1) with sine input to it of Amplitude=1, and frequency set to 1 and it is saved as firstOrderSys.mdl . When I call this in an ode45 function: >>[t,x]=ode45(@firstOrderSys,[0 10],[0 0]) I get the following error message: >>Simulink model firstOrderSys was called with incorrect number of arguments
Many thanks!
Regards, Osman
0 Comments
Answers (1)
Mischa Kim
on 13 May 2014
Osman, how about doing it all in Simulink?
If you select Simulation > Model Configuration Parameters in the Simulink model window you can select ode45 as the solver.
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!