% OBJECTIVE FUNCTION
k = @(x) 1 + 9/29*sum(x(:,2:end),2)
h = @(x,y) 1 - (x./y).^2
f = @(x) [x(:,1), k(x).*h(x(:,1),k(x))]

% OPTIMIZATION SETTINGS
o = struct	% initializing struct
o.d = 30	% dimension of decision variable
o.lb = 0	% lower bounds
o.ub = 1	% upper bounds

% ALGORITHM OPTIONS

o.maxit = 250	% number of iterations 
o.pop = 100	% number of population 

% OPTIMIZATION 
rng(0)	% for tractability 
[popPos,popFront,popCost,popInfo,traceIt] = nsga2(f,o)	% running minimization  

% ANIMATION
% Uncomment the following code to generate animation % 
% rng(0)
% [~,~,~,~,~,info] = nsga2(f,o)
% info.plot = 'pareto'
% info.animate = true	% plot animation 
% info.animfreq = 10	% frame frequency 
% optimview('nsga2',info)