data grouping (like pivot table in excel)

조회 수: 5 (최근 30일)
Kazi Main Uddin Ahmed
Kazi Main Uddin Ahmed 2020년 1월 22일
편집: Mohammad Sami 2020년 1월 23일
I have a Table with 10 attributes (a screenshot is attached).
I need to count the 'event_type' on each day (from 1 to 30) like the pivot table in excel.
Is there any way to do that in matlab
NOTE: i can not use excel with this dataset because of the total row number and also try to use 'pivotable.m' from file exchange but can not use becuase if I convert table to cell header dissappeared.
Thanks in advance.
\Kazi
Capture.JPG

채택된 답변

Mohammad Sami
Mohammad Sami 2020년 1월 23일
편집: Mohammad Sami 2020년 1월 23일
You can use the groupsummary function to summarize your data.
%data = yourdata
out = groupsummary(data,{'Date' 'event_type'});
% this will summarise the counts for all combinations of event_type and 'Date'
% out = groupsummary(data,{'Year' 'Month' 'Date' 'event_type'});
% above will summarise for every day of the year

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by