Find number of rows of each array in a cell

3 views (last 30 days)
I have a cell of size 4x4, and each array in this cell is a matrix having size nx2. How can I find n(number of rows) of each matrix, any idea?

Accepted Answer

Guillaume
Guillaume on 18 May 2017
cellfun(@(c) size(c, 1), yourcellarray)
  3 Comments
Guillaume
Guillaume on 18 May 2017
Edited: Guillaume on 18 May 2017
Faster but deprecated for several years now. Also will not work correctly if the cell array contains objects of a class that overloads the size method (admittedly something very rare).

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!