フィルターのクリア

How can i remove from a cell array, the words in another cell array?

2 ビュー (過去 30 日間)
Brian Leon
Brian Leon 2020 年 4 月 15 日
回答済み: Star Strider 2020 年 4 月 15 日
I want to remove the words I have in stopWords(attached) from the words in another cell array newWords(attached). Is there any way I can do this?

回答 (1 件)

Star Strider
Star Strider 2020 年 4 月 15 日
Try this:
D1 = load('stopWords.mat');
stopWords = D1.stopWords;
D2 = load('newWords.mat');
newWords = D2.newWords;
editedWords = cellfun(@(x,y)setdiff(x,y,'stable'),{newWords},stopWords, 'Unif',0); % (1x1) Cell Array (305x1) Cell
editedWordsList = editedWords{:}; % (305x1) Cell Array
It appears to produce the correct result (‘editedWordList’), although I did not examine it closely.
.

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by