In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to optimize binary functions in MatLab. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Clcclearclose allticfigure (1); fun_plot;hold on%% parameter setting fishnum=100;% generate 100 artificial fish MAXGEN=50;% maximum number of iterations try_number=100;% maximum number of trials visual=1;% perceived distance delta=0.618;% crowding factor step=0.1;% step% initialize fish shoal lb_ub= [- 10 fishnum,lb_ub; LBUB= []; for i=1:size (lb_ub,1) LBUB= [LBUB] Repmat (lb_ub (iMagen 1), lb_ub (iMagen 3), 1)]; endgen=1;BestY=-1*ones (1Mageen);% optimal function value BestX=-1*ones (2MAXGEN) in each step;% optimal independent variable besty=-100;% optimal function value Y=AF_foodconsistence (X) in each step; while genYi2X (:, I) = Xi1;Y (1meme I) = Yi1;elseX (:, I) = Xi2;Y (1MAXGEN) = Yi2 Endend [Ymax,index] = max (Y); figure (1); plot3 (X (1), X (2), Y (index),'.', 'color', [gen/MAXGEN,0,0]) if Ymax > bestybesty=Ymax;bestx=X (:, index); BestY (gen) = Ymax; [BestX (:, gen)] = X (:, index); elseBestY (gen) = BestY (gen-1); [BestX (:, gen)] = BestX (::, gen-1); endgen=gen+1 Endplot3 (bestx (1), bestx (2), AF_foodconsistence ([bestx (1); bestx (2)]), 'ro','MarkerSize',10) xlabel (' x') ylabel ('y') title ('optimal coordinate movement in iterative process of fish swarm algorithm')
%% Optimization process Diagram
Figureplot xlabel ('number of iterations') ylabel ('optimized value') title ('iterative process of fish swarm algorithm') disp (['optimal solution XRV' Magnum num2str (bestx','%1.5f')]) disp (['optimal solution')
Toc
Thank you for reading! This is the end of the article on "how to optimize binary functions in MatLab". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.