function absbvp
clear
N=50;
j=0:N;
x=cos(pi*j/N);
options = bvpset('Stats' , 'on');
solinit = bvpinit(x,[1 0]);
sol = bvp4c(@odefun,@bcfun3,solinit,options);
plot(sol.x,sol.y(1,:),'-x');

function dydx = odefun(x,y) 
dydx = [y(2)   
-abs(y(1))];

function res = bcfun1(ya,yb)
res = [ya(1)-1.5
yb(1)+ 2];

function res = bcfun2(ya,yb)
res = [ya(2)-1.5
yb(1)+ 2];

function res = bcfun3(ya,yb)
res = [ya(2)+ya(1)-1.5
yb(1)+ 2];    