For loop with string comparison
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am getting error with this code. Can someone help me with this ?
for i=1:100
if (S(i).Status=='Active' || S(i).type=='N')
disp(i)
else
continue;
end
end
0 commentaires
Réponse acceptée
Bruno Luong
le 20 Juil 2020
Change to
...
if strcmp(S(i).Status,'Active') || strcmp(S(i).type,'N')
...
end
Plus de réponses (0)
Voir également
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!