Problem concerning the fitness function of the genetic algorithm on MATLAB.
1 view (last 30 days)
Show older comments
Hi everyone,
I need your help for this problem. The fitness function I am considering for my project is the error between two output signals of two simulink models and it has to be the smallest possibile. This is a piece of the code I wrote.
where iHF is a .mat file with dimension 2x50001, iLF is a normal output array with dimension 50001x1 and simulation.DT is the sampling time equal to 1e-5.
The formula to calculate the error is the following:
When I run the matlab code containing the optimization parameters, it gives me an error saying "Your fitness function must return a scalar value".
What should I do?
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!