Effacer les filtres
Effacer les filtres

how to group rows by date

1 vue (au cours des 30 derniers jours)
Amr Hashem
Amr Hashem le 23 Mai 2015
Commenté : Amr Hashem le 24 Août 2015
i have this data
i want to group\sort them to be something like this:
how i can do this ?

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 23 Mai 2015
Modifié(e) : Andrei Bobrov le 23 Mai 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')
  3 commentaires
Andrei Bobrov
Andrei Bobrov le 23 Mai 2015
corrected
Amr Hashem
Amr Hashem le 24 Août 2015
Thanks... its amazing

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by