Problem with plotting FMINCON results

I'm at the moment solving a simple asset allocation model, where I would like to see the iterations and fval during the process.
This is my current setting of the fmincon ..
optimopt = optimset('fmincon');
optimopt = optimset('algorithm','interior-point')
optimopt.MaxIter=7500;
optimopt.MaxFunEvals=7500;
optimopt.TolFun=0.05;
optimopt.Display='final';
optimopt.HessUpdate='bfgs';
optimopt.Tolcon=0.05;
optimopt.Diagnostics='off';
and when i add the following line
optimopt = optimset('PlotFcns',{@optimplotx,@optimplotfval,@optimplotfirstorderopt});
My final results differ completely :( I'm completely lost since I would like to be able to show the results through plotfcns.
What can I do?

 채택된 답변

Alan Weiss
Alan Weiss 2012년 5월 7일

1 개 추천

When you "add the following line" you overwrite all your previous options, and reset them to their default values. To keep your previous options and just update a few:
optimopt = optimset(optimopt,'PlotFcns',{@optimplotx,@optimplotfval,@optimplotfirstorderopt});
I do not understand why you set Display to 'final' instead of 'iter'--you seem to want to see the iterations.
Alan Weiss
MATLAB mathematical toolbox documentation

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by