Genetic Algorithm Additional inputs

7 visualizaciones (últimos 30 días)
Scott Lowrie
Scott Lowrie el 18 de Ag. de 2016
Comentada: Peter Beringer el 14 de Feb. de 2023
So I'm using Matlab's ga tool. I have a function called setup_function that prepares the matrices for the main code. Also, this code has several variables that I want to be able to use in my fitness function for the ga call. So through research, I found the method to do this was to say what I have shown below. I am getting the error "too many input arguments." Any assistance would be greatly appreciated. Thanks.
[x,fval] = ga({@main_function,a,b,c},n,[],[],[],[],LB,UB);

Respuesta aceptada

Walter Roberson
Walter Roberson el 18 de Ag. de 2016
[x,fval] = ga(@(x) main_function(x,a,b,c), n, [], [], [], [], LB, UB);
  3 comentarios
Alan Weiss
Alan Weiss el 18 de Ag. de 2016
Scott, I wonder if you checked the documentation and were unable to find this information. If so, I'd appreciate knowing exactly how you searched. Something like:
In the MATLAB Help system, entered "genetic algorithm additional inputs"
or
in Google searched for "MATLAB additional inputs"
FYI, I have tried to make this information easy to find, but it seems that I failed for you, so I'd like to know how to fix that.
Alan Weiss
MATLAB mathematical toolbox documentation
Peter Beringer
Peter Beringer el 14 de Feb. de 2023
To clairfy, is the relevant documentation for this the "Passing Extra Parameters" section? I'm seeking to implement it in a way that will eliminate the requirement for a global vairable of 5GB of audio signals. I'm only in the starting phases of figuring this out, so want to know that I'm at least on the right track in terms of documentation. Cheers.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Genetic Algorithm en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by