MATLAB: Hello, I am trying to solve the following code with bvp4c

bvp4c

Hello, I am trying to solve the following code with bvp4c
function inclinedcylinder(solver)
if nargin<1
solver = 'bvp4c' ;
end
bvpsolver = fcnchk(solver);
Pr = 7.0;A = -2.2;Ec = 1.0;Gr = 1;Rd = 1.0;Nt = 0.5;Nb = 0.7;Le = 3.0;M = 2;theta_w = 1.5;X = pi/4;
infinity = 10;
maxinfinity = 30;
solinit = bvpinit(linspace(1,infinity,30),[0 1 0 1 0 0 0]);
sol = bvpsolver(@inclode,@inclbc,solinit);
for Bnew = infinity+1:maxinfinity
solinit = bvpxtend(sol,Bnew);
sol = bvpsolver(@inclode,@inclbc,solinit);
eta = sol.x;
f = sol.y;
fprintf('\n');
fprintf('Value computed for f''(0)= %g is %7.5f.\n',0,f(3,1))
plot(eta,f(2,:),'m-.',eta(end),f(2,end),'Linesmoothing','on')
drawnow
axis([1 8 -1 0.1]);
xlabel('\eta')
ylabel(' f '' (\eta)')
end
hold on
function dfdeta = inclode(eta,f)
dfdeta = [ f(2)
f(3)
(f(2)^2-f(1)*f(3)+ A*(f(2)+eta*f(3))-Gr*f(4)*cos(X)-Gc*f(6)*cos(X)+M*f(2))/eta-f(3)/eta
f(5)
((Pr*(-f(1)*f(5))+Pr*(A*eta*f(5))-Pr*Ec*(f(3)^2)-Pr*Nb*eta*f(5)*y(7)-Pr*Nt*eta*(f(5)^2)))/eta-f(5)/eta*(1+Rd*(1+(theta_w-1)*f(4))^3)
f(7)
(-Le*(f(1)*f(7)-A*eta*f(7))-(Nt/Nb)*(f(5)+eta*((Pr*(-f(1)*f(5))+Pr*(A*eta*f(5))-Pr*Nb*eta*f(5)*y(7)-Pr*Nt*eta*(f(5)^2))/eta-f(5)/eta)))/eta-f(7)/eta
];
end
function res1 = inclbc(f1,finf)
res1 = [f1(1)-0
f1(2)+1
finf(2)-0
f1(4)-1
finf(4)-0
f1(7)-(Nt/Nb)*f1(5)-0
finf(6)-0
];
end end But I am getting the following error
Error in ==> bvp4c at 120 [n,npar,nregions,atol,rtol,Nmax,xyVectorized,printstats] = …
Error in ==> inclinedcylinder at 17 sol = bvpsolver(@inclode,@inclbc,solinit);
??? Error: File: inclinedcylinder.m Line: 11 Column: 6 Expression or statement is incomplete or incorrect.
Kindly help me to solve this problem

Best Answer

The error message is very clear: There is an unexpected character in the line 11 of the file "inclinedcylinder.m". It is the 6th character of this line. So please be so kind and check this and if you do not get any clue, post which line this is.
Note that we cannot run this code due to the missing definition of "Gc". But at least I do not get any problems with parsing the file. Are you sure, that the posted code is the one which is failing?