Clear Filters
Clear Filters

how to group rows by date

1 view (last 30 days)
Amr Hashem
Amr Hashem on 23 May 2015
Commented: Amr Hashem on 24 Aug 2015
i have this data
i want to group\sort them to be something like this:
how i can do this ?

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 23 May 2015
Edited: Andrei Bobrov on 23 May 2015
[~,~,z] = xlsread('20150523.xlsx');
c = z(cellfun('isempty',regexp(z,'\')));
[y,~] = datevec(c);
[~,~,c0] = unique(y);
c1 = accumarray(c0,(1:numel(c0))',[],@(ii){c(ii)});
c2 = [c1,repmat({{[]}},size(c1))]';
out = cat(1,c2{1:end-1});
xlswrite('20150523.xlsx',out,1,'B1')

More Answers (0)

Categories

Find more on Shifting and Sorting Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!