필터 지우기
필터 지우기

How to create a frequency table using a list of string values

조회 수: 2 (최근 30일)
Diana Krupnik
Diana Krupnik 2018년 12월 6일
댓글: Star Strider 2018년 12월 9일
Hello,
I have a list of 6,057,936 string values, some are unique, many are repeated multiple times. I need to create a table that lists each unique string (likely 1,000-2,000), as well as the number of times this string occurs. Could anyone help me to do this in Matlab?
Thank you,
Diana

채택된 답변

Star Strider
Star Strider 2018년 12월 6일
I would use unique and accumarray. An example is given in the documentation section Count of Unique Elements (link).
  댓글 수: 2
Diana Krupnik
Diana Krupnik 2018년 12월 9일
This is a great idea, but for my dataset (text string array) accumarray was not working unfortunately. What did work was the summary function. It returned fields for categories (same result as unique) as well as counts.
Thanks again,
Diana
Star Strider
Star Strider 2018년 12월 9일
As always, my pleasure.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by