Using numbers in wordcloud

조회 수: 1 (최근 30일)
snipsnap333
snipsnap333 2020년 5월 14일
댓글: snipsnap333 2020년 5월 14일
Hello,
im trying to create a wordcloud from a string which includes numbers and words, but unfortunately the numbers in the string are ignored.
For example if I try:
wordcloud('hello test 123 hello');
there's only 'hello' and 'test' in the wordcloud.
Does anyone know a way to show numbers in wordcloud?
Thx in advance
  댓글 수: 3
snipsnap333
snipsnap333 2020년 5월 14일
Same result. The numbers are still ignored.
darova
darova 2020년 5월 14일
im lost. don't have other ideas

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

채택된 답변

Cris LaPierre
Cris LaPierre 2020년 5월 14일
Do you have the Text Analytics Toolbox?
Assuming you do not, and you don't have a count of the words, the syntax you need to use is
wordcloud(C)
  • wordcloud(C) creates a word cloud chart from the unique elements of categorical array C with sizes corresponding to their frequency counts. If you have Text Analytics Toolbox™, then C can be a string array, character vector, or a cell array of character vectors.
Split the string and turn it into categoricals.
s = 'hello test 123 hello';
S=split(s)
C=categorical(S)
wordcloud(C)
  댓글 수: 1
snipsnap333
snipsnap333 2020년 5월 14일
Thanks, your solution worked.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Display and Presentation에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by