I'm calculating a variable b inside myodefunc, which is further used to solve a quadprog problem.
The output of this quadrpog is what ode45 uses to integrate y.
function [u,b] = myodefunc(t,y)
Q = [1 0; 0 1];
g = zeros(2,0);
A = f1(t,y)
b = f2(t,y);
u = quadprog(Q,g,A,b);
I need to exit the ode when variable , where k is a positive constant.
Any help or suggestions would be greatly appreciated.