title: How to extract the non-dominated solutions (Pareto front)
body: <p>I have tried so many times to write the code of extracting the non-dominated (or dominated) </p>
  
  <p>solutions  for two objective functions using MATLAB.</p>
  
  <p>I have two simple objective functions:</p>
  
  <p>J1=x.^2</p>
  
  <p>J2=(x-2).^2</p>
  
  <p>and I have a range for x values, say from -5 to 5 and there are, for example, 100 solutions to be </p>
  
  <p>generated randomly within the range specified.</p>
  
  <p>I want to extract the non-dominated solutions from these solutions.</p>
  
  <p>I have no problem of all above operations. What I have done so far is:</p>
  
  <pre><code>   % generating 100 solutions randomly between -5 and 5:
  
     x=-5+10*rand(100,1);
  
     % calculate both objective functions, J1 and J2 at each solution:
  
     J1=x.^2;
  
     J2=(x-2).^2;
  </code></pre>
  
  <p>Now, I faced the problem of how to translate the concept to a written code.</p>
  
  <p>I know the concept of how to extract the non-dominated solutions and Pareto front.</p>
  
  <p>I can do it manually but this will take very long time.</p>
  
  <p>I tried using if statements but the results were not accurate.</p>
  
  <p>I think it is better to extract the indices of the dominated solutions and then remove them from </p>
  
  <p>the main vector x to get the non-dominated solutions.</p>
  
  <p>Thanks in advance</p>