MATLAB: Fsolve including CDFs not enough inputs

cdffsolve

Hello to everyone I am trying to use fsolve to solve 16 equations with 16 variables. One unknown is used to evaluate the normcdf and logncdf. Even though I give all the necessary parameters I get a not enough inputs error.
if true
% code

end
function F = myfun_BGG_entr(c,sigmae,ksie,mon,sigmapsi,delta,alpha,R)
F(1)=c(1)-c(16)*R;
F(2)=c(2)-(sigmae+ksie)*(1-c(13))*c(1)*c(3);
F(3)=c(1)*c(3)*(c(13)-mon*c(12))-R*(c(3)-c(2));
F(4)=c(5)-c(6) + 0.2*c(5)+delta*c(3)+mon*c(12)*c(1)*c(3);
F(5)=c(6)-(1-sigmae)*(1-ksie)*(1-c(13))*c(1)*c(3);
F(6)=c(7)-c(3)+c(2);
F(7)=c(8)-c(9)*c(1)*c(3)/c(8);
F(8)=c(10)+(1-delta);
F(9)=(1-alpha)*c(4)/c(3);
F(10)=c(5);
F(11)=c(11)-logncdf(c(9),-0.5*(sigmapsi)^2,sigmapsi);
F(12)=c(12)-(1- normcdf((0.5*(sigmapsi)^2 -log(c(9)))/sigmapsi,0,1));
F(13)=c(13)-(c(12)+c(9)*(1-c(11)));
F(14)=c(14)-(1-c(11));
F(15)=c(15)-(1/(c(9)*sigmapsi*sqrt(2*(4*atan(1))))*exp(-(log(c(9))+.5*(sigmapsi)^2)^2/(2*(sigmapsi)^2)));
F(16)=c(16)-(c(14)/((c(13)-mon*c(12))*c(14)+(1-c(13))*(c(14)-mon*c(15))));
end
and the errors
if true
% code
end
Error using myfun_BGG_entr (line 19)
Not enough input arguments.
Error in fsolve (line 219)
fuser = feval(funfcn{3},x,varargin{:});
Error in BGG_lev_Rk (line 13)
c=fsolve(@myfun_BGG_entr,x0,sigmae,ksie,mon,sigmapsi,delta,alpha,R);
Caused by:
Failure in initial user-supplied objective function evaluation. FSOLVE cannot continue.
Any help? Thank you

Best Answer

fun = @(c) myfun_BGG_entr(c,sigmae,ksie,mon,sigmapsi,delta,alpha,R);
c=fsolve(fun,x0);