>> data
data =
[1x33 char] [ 0] [11.7701] [17.9263] [2] [2]
[1x33 char] [ 5.5659] [ 0] [ 0] [1] [2]
[1x33 char] [ 0] [ 7.2146] [22.2491] [2] [2]
[1x33 char] [13.1006] [ 0] [ 0] [1] [2]
... lots of lines here
[1x32 char] [25.7023] [ 0] [ 0] [1] [1]
[1x32 char] [ 0] [15.9568] [19.7365] [2] [1]
[1x32 char] [12.9951] [ 0] [ 0] [1] [1]
[1x32 char] [ 0] [ 8.5696] [21.2321] [2] [1]
[1x32 char] [10.4371] [ 0] [ 0] [1] [1]
>> [~,idx] = sort([data{:,6}]);
>> idx([1:2:end,2:2:end]) = idx;
>> new = data(idx,:)
new =
[1x32 char] [ 0] [ 6.4649] [26.5270] [2] [1]
[1x33 char] [ 0] [11.7701] [17.9263] [2] [2]
[1x32 char] [16.2326] [ 0] [ 0] [1] [1]
[1x33 char] [ 5.5659] [ 0] [ 0] [1] [2]
[1x32 char] [ 0] [15.1299] [24.5024] [2] [1]
... lots of lines here
[1x32 char] [12.9951] [ 0] [ 0] [1] [1]
[1x34 char] [22.2777] [ 0] [ 0] [1] [2]
[1x32 char] [ 0] [ 8.5696] [21.2321] [2] [1]
[1x34 char] [ 0] [ 7.6076] [23.7789] [2] [2]
[1x32 char] [10.4371] [ 0] [ 0] [1] [1]
[1x34 char] [16.6640] [ 0] [ 0] [1] [2]
Best Answer