MATLAB: Fmincon too many input arguements

fmincon

I used the fmincon, but always wrong
xi=1;
CAQL=1.33;CLTPD=1;b1=3*CAQL+abs(xi); b2=3*CLTPD+abs(xi);
alpha=0.01;beta=0.01;
fun=@(n) 0;
x0=[10,1];
nonlcon=@CAQL_CLTPD;
a=fmincon(fun,x0,[],[],[],[],[],[],nonlcon);
function:
function [c,ceq] = CAQL_CLTPD
y=@(x,t) normpdf(t+xi*sqrt(x(1)))+normpdf(t-xi*sqrt(x(1)));
g1=@(x,t) chi2cdf(((x(1)-1)*((b1*sqrt(x(1))-t).^2)./(9*x(1)*x(2)^2)),x(1)-1).*y(x,t);
g2=@(x,t) chi2cdf(((x(1)-1)*((b2*sqrt(x(1))-t).^2)./(9*x(1)*x(2)^2)),x(1)-1).*y(x,t);
c{1} = @(x) -(integral(@(t) g1(x,t),0,3*b1*sqrt(x(1)))-(1-alpha)); % CAQL
c{2} = @(x) (integral(@(t) g2(x,t),0,3*b2*sqrt(x(1)))-beta); % CLTPD
ceq = [];
the error message:
Error using CAQL_CLTPD
Too many input arguments.
Error in fmincon (line 639)
[ctmp,ceqtmp] = feval(confcn{3},X,varargin{:});
Error in Untitled (line 11)
a=fmincon(fun,x0,[],[],[],[],[],[],nonlcon);
Caused by:
Failure in initial nonlinear constraint function evaluation. FMINCON cannot continue.

Best Answer

Your nonlinear constraint function must accept the x values that are input, and the returns must be numeric or empty.
You do not have the nonlinear constraint function return a function handle or cell array of function handles.