Effacer les filtres
Effacer les filtres

how remove from a cell array, the words in an other cell array

3 vues (au cours des 30 derniers jours)
elisa ewin
elisa ewin le 18 Juil 2017
Commenté : Andrei Bobrov le 18 Juil 2017
Hi, I want to remove from the cell array word (attached), the words in an other cell array word_bis(attached). I have tried
out_str1 = strjoin(word(~ismember(word,stopwords_cellstring)),' ')
but it gives me an error:
Error using cell/ismember>cellismemberR2012a (line 193)
Input A of class cell and input B of class cell must be cell arrays of strings, unless one is a string.
Can you help me to solve the problem? thanks

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 18 Juil 2017
w2 = word(cellfun(@ischar,word));
out_str1 = strjoin(w2(~ismember(w2,stopwords_cellstring)),' ');
  2 commentaires
elisa ewin
elisa ewin le 18 Juil 2017
thanks, it runs but I want like output a cell array, not a string
Andrei Bobrov
Andrei Bobrov le 18 Juil 2017
w2 = word(cellfun(@ischar,word));
out = w2(~ismember(w2,stopwords_cellstring));

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Cell Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by