Your question is not quite clear, but if your problem is roughly analogous to $\frac{d\mathbf{x}}{dt}=\mathbf{f}[\mathbf{x},y]$ , $g[\mathbf{x},y]=0$ then you just need to use a [mass matrix](http://www.mathworks.com/help/matlab/ref/ode15s.html) in your call to ode15s. This is how you "tell" Matlab that you have an algebraic equation. That is, in Matlab pseudo-code you can express the above as eye(n)*dxdt = f(x,y) % n=length(x) 0 *dydt = g(x,y) % y is a scalar which you would pass to ode15s as a single system M*dzdt = h(z) % here z=[x;y] , h=[f;g], and M = blkdiag(eye(n),0) The particular syntax will depend on you specific system. The relevant part of the help in the above link begins where it says: "If the mass matrix M is singular, then M(t,y)y′ = f(t,y) is a system of differential algebraic equations."