how to group rows by date
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Amr Hashem
el 23 de Mayo de 2015
Comentada: Amr Hashem
el 24 de Ag. de 2015
i have this data
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150455/image.jpeg)
i want to group\sort them to be something like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150456/image.jpeg)
how i can do this ?
0 comentarios
Respuesta aceptada
Andrei Bobrov
el 23 de Mayo de 2015
Editada: Andrei Bobrov
el 23 de Mayo de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!