 

function XX = update (XX,XXNEW,fobj)
[NN,DD]=size(XX);

fitval=zeros(1,NN);
fitvalnew=zeros(1,NN);
 
for i=1:NN 
  fitval(i)=fobj(XX(i,:));
  fitvalnew(i)=fobj(XXNEW(i,:));
  if (fitvalnew(i)<fitval(i))
     XX(i,:)=XXNEW(i,:);
  end   
end

endfunction
