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!

