In a cell array, how I can count the number of cells in each column?

23 views (last 30 days)
Fercho_Sala
Fercho_Sala on 27 May 2021
Commented: Fercho_Sala on 28 May 2021
Hello, I’m doing a statistical analysis however gotte deal with these kinds of arrays. The idea is to get a vector with the number of cells in each column of the cell array (attached). Thanks.

Accepted Answer

Matt J
Matt J on 27 May 2021
cellfun('length',locs)
  6 Comments
Fercho_Sala
Fercho_Sala on 28 May 2021
@Matt J For example, Using writecell(locs’,filename,’sheet’,1) works so good, but the matter is that this function is only to create a .xls file, and I need this in at least .mat extension.

Sign in to comment.

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!