How to use both pswplotbestf and pswplotranges for particleswarm?
Ältere Kommentare anzeigen
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 Kommentar
Ashutosh
am 16 Aug. 2023
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.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Particle Swarm finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

