File: ef230-2023-08/www/examples/wordcloud_generator.m Download
% from https://www.mathworks.com/help/deeplearning/ug/word-by-word-text-generation-using-deep-learning.html?s_tid=blogs_rc_4
% You can change the url below to any url with sufficient text
url = "https://news.utk.edu/2020/08/20/sneak-peek-students-2020-21-academic-year/";
code = webread(url);
tree = htmlTree(code);
selector = "p";
subtrees = findElement(tree,selector);
textData = extractHTMLText(subtrees);
textData(1:10)
textData(textData == "") = [];
textData(1:10)
figure
wordcloud(textData);
title("Word Cloud")