MATLAB: Ode45 won’t produce te or xe

eventsMATLABode45

I'm trying to run ode45 with events on a function (cancerEqsVaryBurden). The events script is critCells, and the main script is CancerModelFinite. I'm having trouble in the innermost for loop with getting ode45 to give xe or te. In my experience this has been caused by running through tspan without triggering an event, but that shouldn't be the case here. I can increase tspan as much as I want and it still throws the error.
Attached are the relevant scripts plus others to make the main code work.
Thanks for helping!

Best Answer

Your code didn’t post, but in your previous post, your ODE didn’t do anything that might trigger an ‘event’, like a zero-crossing.
When you plot the output of your ODE integration, does it look as though it should have triggered an event?