nsga2 solves for the Pareto frontier in multi-objective problems using the Non-dominated Sorting Genetic Algorithm II.

[popPos,popFront,popCost,popInfo,traceIt,info] = nsga2(f,o,objmin)

  • f: function handle
  • o: optimization options
  • objmin: logical vector to define if fi(x) is a minimization (true) or maximization(false) objective
Options Description Values Default values
d Dimension positive integer number of variables
g Constrains function handle []
lb Lower bounds double realmin/100
ub Upper bounds double realmax/100
display Information display level 'iter' 'iter'
pop Population size positive integer 10
maxit Maximum Number of Iterations positive integer 10
  • popPos: contains position for the entire population (each row corresponds to one individual)
  • popFront: pareto frontier indices (popPos(popFront,:) returns the Pareto frontier positions)
  • popCost: the cost for each individuals
  • popInfo: additional information for each individual: rank, crowding distance, feasibility
  • traceIt: cell array storing all the above outputs at each iteration
  • info: struct object with information for the animation


Call optimview('nsga2',info), being popInfo the forth output of nsga2. Some animation options can be specified appending them to the struct object info.
Options Description Values Default values
plot Plots pareto front or position of the population 'pos', 'pareto' {'pos' 'pareto'}
animate Generates the animation logical true
animfreq Frame frequency positive integer 1
animstart Inicial frame to start animation positive integer 1


[1] K. Deb, Associate Member, IEEE, A. Pratap, S. Agarwal, T. Meyarivan, "A fast and elitist multiobjective genetic algorithm: NSGA-II", IEEE Transactions on Evolutionary computation, Vol. 6, NO. 2, 2002.

See also

fminsearch | lsqcurvefit