M=[20 15 NaN;21 30 85;22 NaN NaN;23 30 50;24 15 NaN;25 NaN NaN;26 70 47;27 NaN 32; 28 85 11;29 45 51]
[m,n]=find(isnan(M))
J=[] ;
s=length(m);
p=[];
for k=1:s
    J=[J;M(m(k),1)]
 end
 J
 for i=1:length(J)
     for j=1:length(J)
         if J(i,1)==J(j,1) & i~=j & i<j
             p=[p;j];
                
         end
                
     end
 end
%     J(p(:,1))=NaN
%     t=find(~isnan(J));
%     J=J(t,1)
J=J';
J(p(:,1))=[]