% NAO FUNCIONA!
[x1,x2]=meshgrid(-2:0.1:2,-2:0.1:2);
z1=x1.^2+x2.^2-4;
z2=100*(x2-x1.^2).^2+(1-x1).^2;
zz1=z1(:);
zz2=z2(:);

[w,i]=sort(zz1);
j=i(find(diff(w)));

n=size(j);
y=[];
for k=1:n,
   m = find(~(zz1 - zz1(j(k))));
   y = [y min(zz2(m))];
end

x=zz1(j);
plot(x,y,'.');
