Removing zeros from rows of a cell matrix

10 views (last 30 days)
I have a long 1 column matrix (891,1) where each row consists of either a name in characters or a zero in each row. How can I neaten up my matrix by getting rid of all the zeros in between leaving just a column of names?

Accepted Answer

Jan
Jan on 21 Mar 2021
C = C(cellfun('isclass', C, 'char'))

More Answers (0)

Categories

Find more on Language Fundamentals in Help Center and File Exchange

Products


Release

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!