The method of solving these is the "shooting method", where you define a function:
Originally Posted by kdineshkumar
Where yFinal is the required value at x=1. Note the second argumant of ode45 is the tspan and the third the initial conditions. So here we are solving the BVP y'=f(x,y) subject to y(0)=0, y(1)=yFinal.
function endV=gash(Dy0, yFinal)
[X Y]=ode45(@odefun,[0 1],[0 Dy0]);
Now find a couple of intial values of y'(0) so that the product of the corresponding endV's is negative, then use the bisection method to find y'(0) such that endV is 0, and that is it.
(You solve the IVP with varying initial derivatives untill you find an IVP that matches the required end value)