raw={'06-Nov-2000' '16-Dec-2000' 0.47 0
'06-Nov-2000' '16-Dec-2000' 0.41 0
'06-Nov-2000' '16-Dec-2000' 0.29 0
'06-Nov-2000' '16-Dec-2000' 0.14 0
'06-Nov-2000' '16-Dec-2000' 0.03 1
'06-Nov-2000' '16-Dec-2000' 0.18 0
'06-Nov-2000' '18-Nov-2000' 0.03 1
'06-Nov-2000' '18-Nov-2000' 0.31 0
'06-Nov-2000' '18-Nov-2000' 0.44 0
'06-Nov-2000' '18-Nov-2000' 0.45 0
'06-Nov-2000' '18-Nov-2000' 0.44 0
'06-Nov-2000' '18-Nov-2000' 0.44 0
'06-Nov-2000' '18-Nov-2000' 0.45 0
'06-Nov-2000' '18-Nov-2000' 0.45 0
'07-Nov-2000' '18-Nov-2000' 0.36 0
'07-Nov-2000' '18-Nov-2000' 0.09 1
'07-Nov-2000' '18-Nov-2000' 0.15 0
'07-Nov-2000' '18-Nov-2000' 0.38 0
'07-Nov-2000' '18-Nov-2000' 0.48 0
'07-Nov-2000' '18-Dec-2000' 0.50 0
'07-Nov-2000' '18-Dec-2000' 0.01 1
'07-Nov-2000' '18-Dec-2000' 0.15 0};
Date1=raw(:,1);
Date2=raw(:,2);
Err=cell2mat(raw(:,3));
RawTarget=cell2mat(raw(:,4));
Target=false(size(Err));
Date=cellstr(cell2mat([Date1,Date2]));
UniqueDate=unique(Date);
for k=1:length(UniqueDate)
Index=ismember(Date,UniqueDate(k));
Loc=find(Index);
[Dummy,MinIndex]=min(Err(Index));
Target(Loc(MinIndex))=true;
end
Target=and(Target, Err<0.1);
all(Target==RawTarget)
Best Answer