Using numbers in wordcloud

15 views (last 30 days)
snipsnap333
snipsnap333 on 14 May 2020
Commented: snipsnap333on 14 May 2020
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 Comments
darova
darova on 14 May 2020
im lost. don't have other ideas

Sign in to comment.

Accepted Answer

克里斯·拉皮埃尔
克里斯·拉皮埃尔 on 14 May 2020
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 ofcategorical arrayCwith sizes corresponding to their frequency counts. If you have Text Analytics Toolbox™, thenCcan 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 Comment
snipsnap333
snipsnap333 on 14 May 2020
Thanks, your solution worked.

Sign in to comment.

More Answers (0)

下载188bet金宝搏


释放

R2019b

Community Treasure Hunt

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

Start Hunting!