How to use both pswplotbestf and pswplotranges for particleswarm?
古いコメントを表示
I've noticed that having both 'pswplotranges' as 'OutputFcn' and 'pswplotbestf' as 'PlotFcn' in the particleswarm option enabled does not work. It appears that it's only possible to get either one of the plots from an optimization. Is there a way to get both? Thank you.
1 件のコメント
Ashutosh
2023 年 8 月 16 日
The use of "pswplotranges” as the "OutputFcn” and "pswplotbestf” as the "PlotFcn" in the "particleswarm" options does not work is due to way the Particle Swarm Optimization algorithm handles the plotting.
The issue arises when using both options of "pswplotranges" as the "OutputFcn" and " pswplotbestf " as the "PlotFcn". These two functions are designed to generate different types of plots. "pswplotranges" generates a range plot that shows the range of particle positions at each iteration, while "pswplotbestf" generates a plot showing the best function value over iterations.
Since both functions are intended to generate plots, there is a conflict in how they are called and handled by the "particleSwarm" algorithm. The algorithm is designed to handle either an "OutputFcn" or a "PlotFcn", but not both simultaneously. As a result, when both functions are specified, it leads to errors or unexpected behavior.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Optimization Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

