How to speed up ode solver with "Events" options

I have a ODE system written in M-file already, and I need to solve it in a big loop several time. I set the Event property in odeset ,which check one of the state reaching a particular value and stop the solving procedure.
In order to speed up the loop, I tried use codegen command to create MEX file, however it doesn't support the Event option.
So I want to know whether I use codegen command wrong or is there any good way to speed up?

Risposte (0)

Categorie

Richiesto:

il 3 Ott 2013

Community Treasure Hunt

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

Start Hunting!

Translated by