MATLAB: Find values from a matrix according to a criterion

find

I have a time series of measurements as follows:
time = [733774,733774,733775,733775,733775,733776,733776];
data = [1,1.3,1,2.5,2.5,1,1.2];
Final = [time',data'];
I want to create a new variable that only contains the values that contain more than two measurements for individual days. So, from the example above, the result should be:
newData = [[733775;733775;733775],[1;2.5;2.5]];

Best Answer

time = [733774,733774,733775,733775,733775,733776,733776];
data = [1,1.3,1,2.5,2.5,1,1.2];
unik_time = unique(time);
rep_time = arrayfun(@(x) (sum(ismember(time,x)) > 2),unik_time);
idx = ismember(time,unik_time(rep_time));
your_time = time(idx);
your_vals = data(idx);