format short;
a=0;
b=7;
S1=0;
S2=1;
yp=2;
k=0;
hold on
while abs(yp-1)>1e-3
	S=(S1+S2)/2;
	y0=[S,0,0];
	[x,y]=ode45('Blasius',[a:0.5:b],y0);
	[m,n]=size(y);
	if y(m,2)<1 
	S1=S;
	else 
	S2=S;
	end;
   yp=y(m,2);
   k=k+1;
   fprintf('nr_iter=%d ys=%f yp=%f\n', k,S,yp)
   plot(x,y(:,2));
   pause;
end;

A=[x,y];
disp('  eta        fsec           fprim          f  ') 
disp(A);
plot(x,y(:,2));
