There are built in function to do this see the documentation at:
Solve boundary value problems for ordinary differential equations - MATLAB
CB
There are built in function to do this see the documentation at:
Solve boundary value problems for ordinary differential equations - MATLAB
CB