This is driving me crazy. I have almost this exact line of code in another program and it works perfectly.
bellman_handle = @(capnext)bellmanRHScont(capnext,transd(j,:), c , x(i), start, beta, theta(j), b, mc); [action,value]=fmincon(bellman_handle,1,[],[],[],[],0,k,[],[],options);
I am using an anonymous function, but when I run the code I get the following error. Any ideas?
Error using@(capnext)bellmanRHScont(capnext,transd(j,:),c,x(i),start,beta,theta(j),b,mc)Too many input arguments.Error in fmincon (line 564) initVals.f = feval(funfcn{3},X,varargin{:});Error in testmodelcont (line 100) [action,value]=fmincon(bellman_handle,1,[],[],[],[],0,k,[],[],options);Caused by: Failure in initial user-supplied objective function evaluation. FMINCON cannot continue.
Best Answer