How do I use use logical relations on a character array?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Anonymous Matrix
il 15 Feb 2017
Commentato: Anonymous Matrix
il 15 Feb 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 Commenti
Risposta accettata
Stephen23
il 15 Feb 2017
>> a = {'cat';'dog';'hamster';'shark';'duck';'bat'};
>> a(cellfun('length',a)>3)
ans =
'hamster'
'shark'
'duck'
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Multidimensional Arrays in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!