"Frank " <email@example.com> wrote in message <firstname.lastname@example.org>... > Hello, I want to pass extra parameters to constraint functions using fmincon. > > K = 1; > nonlin = @(x) fcon(x, K); > > My code is > y = fmincon(@(x)myfun5(x,t), x0, , , , , zeros(Lt^2+1, 1), , nonlin, options); > > But an error occurs: > > Too many output arguments. > Caused by: > Failure in initial user-supplied nonlinear constraint function evaluation. FMINCON cannot continue. > > Can anyone help? > > Thanks.