Can we categorize and sum 2 columns from table
이전 댓글 표시
Here I've a table data temp with disease names & date as columns. How can I find sum/count of a particular disease on a given day. Was able to calculate individually:
%%for disease
data_temp.Disease = categorical (data_temp.Disease);
m_val = unique (data_temp.Disease );
m=arrayfun(@(x) sum(data_temp.Disease==x),m_val);
%% categorising &counting Date
data_temp.Date = categorical (data_temp.Timestamps);
date = unique (data_temp.Date);
m=arrayfun(@(x) sum(data_temp.Date==x),date);
How can we use both parameters together?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Descriptive Statistics and Visualization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!