how to define fitness function in ga tool box???

3 views (last 30 days)
fitness=1/f+k(1/SoNZ) where, f=max[H(e^jw)-H(e^jw)] SoNZ=sum of non zero digits in canonical signed digit format how to define this fitness in ga tool box??

Answers (1)

Geoff Hayes
Geoff Hayes on 12 Oct 2014
See the documentation at Find minimum of function using genetic algorithm. The basic signature for a fitness function can be written as
function [fitness] = myFitnessFunc(inputVars)
where
  • inputVars is a row vector of variables that you are optimizing on
  • fitness is the scalar output that is used to determine the fitness of the "organism" (with the input variables) relative to other organisms in the population. Since the GA problem is to minimize, the smaller the fitness, the better (more fit) the organism.

Tags

Community Treasure Hunt

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

Start Hunting!