Error using ==> vertcat in fmincon loop, cannot be related to simple dimension misfit

3 views (last 30 days)
Hi guys,
I am running an optimization using fmincon for different parameters values. So I run a loop during which one parameter (a price in an economic model) gets increased. Everything works fine for some iterations, but at some point I get the following error message:
??? Error using ==> vertcat
CAT arguments dimensions are not consistent.
Error in ==> C:\Program
Files\MATLAB\R2010b\toolbox\optim\optim\private\formJacobian.p>formJacobian
at 24
Error in ==> C:\Program
Files\MATLAB\R2010b\toolbox\optim\optim\barrier.p>barrier at 601
Error in ==> fmincon at 806
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] =
barrier(funfcn,X,A,B,Aeq,Beq,l,u,confcn,options_ip.HessFcn, ...
...
Since the code works for the first iterations, the reason for the error should not be a simple dimension misfit of some matrix.
I actually get the following warning before the error occurs:
Warning: Infinite or Not-a-Number function value encountered.
I use the following settings for the fmincon algorithm:
options = optimset('Algorithm','interior-point','MaxFunEvals',5000,'TolFun',1e-9);
Thanks a lot for any suggestions.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!