How can i remove from a cell array, the words in another cell array?
조회 수: 1 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
답변 (1개)
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.
.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!