removing words from texts with 'removeWords' ???

조회 수: 3(최근 30일)
Kamyar Mazarei
Kamyar Mazarei 2021년 5월 2일
답변: KSSV 2021년 5월 3일
hi
i want to remove 150 words from 2226 texts (1x150 and 1x2226 matrixes)
i googled it and this came up
but when i use it in matlab it says: Undefined function or variable 'removeWords'.
i also cant find it on my matlabs search tab
is this for another version?
is there another code?
if not can you help me pelase
thank you
  댓글 수: 2
Kamyar Mazarei
Kamyar Mazarei 2021년 5월 3일
oh i see
sry im new to matlab didnt notice that
lets say matrix A is 2226 texts
and marix B is 150 words i want to remove
i wanted something like A=removewords(A,B)

댓글을 달려면 로그인하십시오.

답변(1개)

KSSV
KSSV 2021년 5월 3일
str1 = 'Hello world, how are you?' ;
str2 = 'how are you?' ;
str=setdiff(strsplit(str1),strsplit(str2))
str = 1×2 cell array
{'Hello'} {'world,'}

Community Treasure Hunt

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

Start Hunting!

Translated by