Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to count the total count of each unique occurance

조회 수: 1 (최근 30일)
Kanakaiah Jakkula
Kanakaiah Jakkula 2016년 6월 3일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi,
I have below Table, and I want to count
  1. Total count of data(just column1)
  2. Total count of passed cases
  3. Total count of failed cases
  4. Total count of struck
  5. Total count of removed cases.
RCP1 passed
RCP4 passed
RCP6 failed
RCP2 passed
RCP2 failed
RCP3 failed
RCP5 passed
RCP2 struck
RCP2 passed
RCP4 passed
RCP4 passed
RCP4 struck
RCP4 removed
Many thanks in advance.

답변 (1개)

the cyclist
the cyclist 2016년 6월 4일
Here's one way:
C = {
'passed'
'passed'
'failed'
'passed'
'failed'
'failed'
'passed'
'struck'
'passed'
'passed'
'passed'
'struck'
'removed'};
G = grpstats(table(C),'C');
sum(G.GroupCount)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by