필터 지우기
필터 지우기

how to group rows by date

조회 수: 1 (최근 30일)
Amr Hashem
Amr Hashem 2015년 5월 23일
댓글: Amr Hashem 2015년 8월 24일
i have this data
i want to group\sort them to be something like this:
how i can do this ?

채택된 답변

Andrei Bobrov
Andrei Bobrov 2015년 5월 23일
편집: Andrei Bobrov 2015년 5월 23일
[~,~,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
Andrei Bobrov
Andrei Bobrov 2015년 5월 23일
corrected
Amr Hashem
Amr Hashem 2015년 8월 24일
Thanks... its amazing

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by