What do I need to fix in this code to get the maximum value?

1 visualización (últimos 30 días)
%% optimmization algorithm
% source : https://sites.google.com/a/hydroteq.com/www/
clc
% HS: Harmony Search minimization
% Use the Matlab startup random number sequence:
rand('twister',5489); % Commment out to start rand from current position
% Specify objective function and bounds
f = Zq;
xL = [0.01 0.01]; % minimum range
xU = [0.81 0.81]; % maximum range
% Set HS algorithm parameters
HSparams.HMS = 10;
HSparams.MaxImp = 10000;
HSparams.HMCR = 0.8;
HSparams.PAR = 0.4;
HSparams.b = (xU-xL)/1000;
% Perform minimization
[xbest,fbest] = harmony(f,xL,xU,HSparams);
fprintf('Best solution found:\n')
disp(xbest)
fprintf('Function value = %f\n', fbest)
I want the max but I get the min
What do I need to fix in this code to get the maximum value?

Respuesta aceptada

Star Strider
Star Strider el 26 de Oct. de 2021
This is at least the second time (the first that I°m aware of is how to get maximum value of this code) you’ve asked the same question and still haven’t supplied the necessary information!
  4 comentarios
kyungdoo lee
kyungdoo lee el 26 de Oct. de 2021
Thank you for saying this. In the future, I will follow the rules and ask good questions.
Star Strider
Star Strider el 26 de Oct. de 2021
As always, my pleasure!
Please just be patient and provide the requested information, if it is not provided initially.
.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by