I have a sample dataset of the form below and I want to sort into group of A = 11 – 20, B = 21 – 30, C = 31 – 40, etc. using the second column to do the sorting. I tried this
N = sortrows(N,2);if N(:,2)<=0; N0 = N; elseif (N(:,2)>=1) & (N(:,2)<=10); N10 = N; elseif (N(:,2)>10) & (N(:,2)<=20); N20 = N;elseif (N(:,2)>20) & (N(:,2)<=30); N30 = N;elseif (N(:,2)>30) & (N(:,2)<=40); N40 = N;if N(:,2) > 40 N50 = N50(N);end
but nothing was displayed
DATASET16.07 88.9 100715.91 89.1 100719.87 67.48 100820.45 61.71 100821.62 53.97 100922.02 47.95 100918.54 82.9 100618.66 82 100618.46 84.1 100618.36 83.6 100624.38 54.33 100825.18 50.33 100825.9 46.73 100826.46 45.79 100830.29 31.58 100630.33 29.83 100631.76 24.36 100432.37 24.63 100432.38 26.74 100432.23 24.22 1004
Best Answer