How do I use if with the value of the array is a string?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to check if the final value of the string is 'NaN'
parents=[2 3 1 NaN];
f = parents(size(parents,2));
if f == 'NaN'
check=0
else
check=1
end
0 commentaires
Réponse acceptée
per isakson
le 4 Mai 2019
Modifié(e) : per isakson
le 4 Mai 2019
Replace
if f == 'NaN'
by
if isnan( f )
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Cell Arrays 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!