MATLAB: BVP4C: Error: Unable to solve the collocation equations — a singular Jacobian encountered

Hello, I am facing "Unable to solve the collocation equations — a singular Jacobian encountered" error using BVP4C function.Below are the details:
function Pearsonproblem
options = bvpset('NMax',1000000); M=50;
solinit = bvpinit(linspace(0,10,10000),[0 0 1 1 1 1],M);
sol = bvp4c(@fourode,@fourbc,solinit,options);
save hatimsol.mat sol
x = linspace(0,1);
y = deval(sol,x);
plot(x,y(1:3,:))
%

function dydx = fourode(x,y,M)
k=2;
dydx = [ y(2); y(3); y(4); -(k^4)*y(1)+2*k^2*y(3); y(6); k^2*y(5)-y(1)];
%
function res = fourbc(ya,yb,M)
e=0;
k=2;
res = [ ya(1); ya(2); ya(5); yb(1); yb(3)/((k^2)*yb(5))+M; yb(6)+e*k*yb(5);ya(3) ];
Please help me resolve this error. Thanks.

Best Answer

6 equations - 6 boundary conditions, not 7.
Best wishes
Torsten