How to select only ADJECTIVES from a list of strings?
Show older comments
Answers (1)
Matt J
on 10 Sep 2020
Do you have a list of adjectives to cross check against? And what if a word is both an adjective and a noun, like "orange"? If you just want to know if a word belongs to another list containing exclusively adjectives, you can use ismember, e.g.,
>> adjectives={'red','three','passive','candid'};
>> s=["red","person","woman","man","camera","tv","three"]
>> ismember(s,adjectives)
ans =
1×7 logical array
1 0 0 0 0 0 1
1 Comment
Salad Box
on 10 Sep 2020
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!