do you mind files from FEX? This one works perfectly: "Pareto Front" by Yi Cao
giving you the indices of x
of dominating solutions.
Then you just have to use it like this:
x=-5+10*rand(100,1);
J1=x.^2;
J2=(x-2).^2;
idx = paretofront([J1,J2]);
xdi = ~ismember(idx,1:numel(x));
figure(1)
hold on
scatter(J1,J2,10,'red');
scatter(J1(idx),J2(idx),50,'blue');
scatter(J1(xdi),J2(xdi),50,'green');
hold off
legend('all solutions','dominating solutions','non dominating solutions')
leads to:
which is exactly how it is supposed to look like. Otherwise you need to clarify your question.