extract number of columns in each row

2 views (last 30 days)
ar
ar on 3 Oct 2022
Edited: Stephen23 on 3 Oct 2022
  1. I have the following variable with a list of rows - each containing a [1 x n] matrix. Is there a way to extract the n for each row into a separate variable?

Accepted Answer

Stephen23
Stephen23 on 3 Oct 2022
Edited: Stephen23 on 3 Oct 2022
Where C is your cell array:
V = cellfun(@numel,C)
V = cellfun('size',C,2)

More Answers (0)

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!