I assume that you want to solve $$f(t,y',y)=0 \text{ on } (0,T)$$ with two-point boundary values $$y(0)=\alpha \text{ and } y(T)=\beta.$$
You cannot simply apply ODE solvers to this problen unless you take the heuristic approach of forward-backward iteration (see the list below).
There is no general approach to these boundary value problems. And I don'tdon't didn't know of any built-in function in Matlab that solves these boundary value problems even for the case with $y' = \tilde f (t,y)$.
[EDIT: There are matlab functions for solving these semi-explicit two point boundary value problems, see David Ketcheson's answer, that use finite differences and collocation. ]
So, my answer is, there is no answer to your particular question, how to make Matlab's ODE solvers handle your problem.
To solve the problem you have the following options:
- Finite Differences: Discretize the interval $[0,T]$, if necessary do a collocation, and solve the resulting algebraic system
- (Multiple) Shooting: parametrize the boundary conditions and solve for the parameters
- Decoupling: split the variables so that there is one initial value problem, and one terminal value, i.e. backward in time initial value, problem. In the linear case this is commonly referred to as Riccati decoupling
- Fixed-point Iteration: this is the most heuristic approach. For example, you can try to guess the missing intial values, integrate forward in time, set the part of the terminal value to the given values, integrate backward in time, and so on...
The standard reference for these problems is the book by Ascher, Mattheij, & Russell: Numerical solution of boundary value problems for ordinary differential equations. However, implicit problems are not considered there.