I have a matrix (as attached) I try to find rows that has a specific number in the 2nd column as N. It works when try N=1 or N=0 and extract the the new data from the original DATA. But when I pick a number from column 2 other than 1 or 0 For example the number in DATA(3044,2) which is (0.123945562585054) the code doesNOT work. I'm wondering if it is the precision or what ? Any help is highly appreciated:
data=[]; N=1; for j=1:length(DATA); if DATA(j,2)==N; data =[data;DATA(j,:)] else data=[data]; end end
Best Answer