How can I troubleshoot this fmincon error?
6 次查看(过去 30 天)
显示 更早的评论
Hello
I'm using the fmincon function to solve an optimization problem, but after the 2nd iteration(the first 2 runs fine), it gives me the following error:
Matrix dimensions must agree.
Error in finitedifferences
Error in computeFinDiffGradAndJac
Error in barrier
Error in fmincon (line 813)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] = barrier(funfcn,X,A,B,Aeq,Beq,l,u,confcn,options.HessFcn, ...
Error in ellipsoidOptimization (line 40)
[d,fval] = fmincon(volumefun, d0, [], [], [], [], lb , ub, nlcon)
I have no idea what to check.
4 个评论
Torsten
2019-8-13
If you don't call fmincon anew for each iteration, c and ceq must have constant size.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!