How do I use use logical relations on a character array?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Anonymous Matrix
am 15 Feb. 2017
Kommentiert: Anonymous Matrix
am 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 Kommentare
Akzeptierte Antwort
Stephen23
am 15 Feb. 2017
>> a = {'cat';'dog';'hamster';'shark';'duck';'bat'};
>> a(cellfun('length',a)>3)
ans =
'hamster'
'shark'
'duck'
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!