How to check if a string is an element of a string set?

For example the set is {"aaa" "bbb" "ccc"} and I want to check if mystring == "aaa" mystring == "bbb" mystring == "ccc" But in general, I would like to collect and represent the set in a data structure, and make the check as simple as possible.

Answers (1)

The ismember() function is used for this purpose.

Categories

Asked:

on 29 Jun 2015

Answered:

on 29 Jun 2015

Community Treasure Hunt

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

Start Hunting!