Exchange data in MAtlab when using the genetic algorithm toolbox.

조회 수: 2 (최근 30일)
Zied
Zied 2013년 11월 25일
댓글: Alan Weiss 2013년 11월 25일
Hello Everyone,
I would like to use the genetic algorithm in the tool box of Matlab but I would like to generate the fitness function of each population through another software(labview: the fitness is measured experimentally). So Matlab generate only the new input variables. Is it possible to force matlab to read the finess in function.m file by asking to important the values of the fitness from a spreadsheet for example instead of calculating f(x) for each population inside the function.m file? If this impossible (in the case Matlab reads only the function.m one time in the begining of the optimization then use it for all population), can I modify the GA tool to force it to read the fitness in the roulette step from an external file? Best regards,
PhD student Glasgow University

채택된 답변

Alan Weiss
Alan Weiss 2013년 11월 25일
If you can define the fitness function programmatically in MATLAB, in any way whatsoever including reading from a file, then you can use GA. There is nothing wrong with using an xlsread() statement inside a fitness function file.
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 2
Zied
Zied 2013년 11월 25일
Thanks Alan, I will try xlsread(). Just want to ask you a small question as I plan to put the code in Mathscript of Labview. In this case, I cannot open the GATOOL. In the main of Matlab I can write optimtool ('ga') to call the genetic algorithm solver and then I put my parameters. Actually, I have to put everything in the script box of Labview. Is it possible to define those parameters in predefined file then call them in script or write the parameters of the GA in the script like we do in python or C. Thanks,
Alan Weiss
Alan Weiss 2013년 11월 25일
Sorry, I do not know anything about Mathscript or Labview.
If you are asking for a programmatic way in MATLAB of opening the Optimization app (formerly called Optimization Tool) and filling in fields, then I am afraid that there is no such thing. Of course, you can call GA at the command line, bypassing the app altogether.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by