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

1 件のコメント

DankoJones
DankoJones 2012 年 5 月 8 日
Cheers, should have seen that.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with Optimization Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by