You must write the ODE as a system of first-order ODEs. Use the substitution u1 = y and u2 = y'. Then, you'll end up with equations like
u1' = u2
u2' = F(u1,u2)
where F is a function of u1 and u2 (y and y')... Once you have those equations, create a function named F, like
function uPrime = F(u)
uPrime(1) = u(2);
Note that the input u should be a two-dimensional vector where the comoponent u(1) represents u1, and u(2) represents u2. The output is also a two-dimensional vector, one element for each first-order differential equation in the system above. Such an interface to F is dictated by the requirements of the fsolve function.