How do I eliminate strings with length < 3 from cellarray
Mostrar comentarios más antiguos
I'm trying to remove all string with length < 3 from a cell array. But the output is not what I expect.
For example:
days = {'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'}; abbrev = cellfun(@(x) x(length(x) > 3), days, 'UniformOutput', false)
It returns:
abbrev =
'M' 'T' 'W' 'T' 'F'
But I need it to return the whole word that is bigger than 3.
Anyone knows how to do it?
Thanks.
Respuesta aceptada
Más respuestas (1)
Categorías
Más información sobre Structures en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!