checking of existing an string in a cell arrays

767 vues (au cours des 30 derniers jours)
mohammad
mohammad le 21 Sep 2011
Commenté : Visweswar Bulusu le 27 Juin 2020
There is a cell in name of 'CELL'. it is 1*12000 . its needed to check being and existing of a specified string in arrays of 'CELL'. so if the string doesn't exist do something
for example:
CELL={'a','b','c','d',...};
if 'a' not exists in CELL
do something
end

Réponse acceptée

Lucas García
Lucas García le 21 Sep 2011
if ~any(strcmp(CELL,'a'))
% Do Something
else
% Do Something else
end
  4 commentaires
mohammad
mohammad le 21 Sep 2011
Thanks a lot
Visweswar Bulusu
Visweswar Bulusu le 27 Juin 2020
Thanks ...useful

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings 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