How do I use use logical relations on a character array?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Anonymous Matrix
le 15 Fév 2017
Commenté : Anonymous Matrix
le 15 Fév 2017
Say like I have an array animals=[cat;dog;hamster;shark;duck;bat]. How do I get an array that only contains animals that is spelled with 4 or more letters?
0 commentaires
Réponse acceptée
Stephen23
le 15 Fév 2017
>> a = {'cat';'dog';'hamster';'shark';'duck';'bat'};
>> a(cellfun('length',a)>3)
ans =
'hamster'
'shark'
'duck'
3 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Multidimensional 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!