QUestion regarding Number of elements in a cell

1 次查看(过去 30 天)
I've a cell array
X{1,1} = [1,2,3,4];
X{1,2} = [1,3];
X{2,1} = [1,3,4];
X{2,2} = [1,4,5];
I wanted to find the number of elements in each cell. my output should be ,for example, number of elements in X{1,1} = 4 and so on. Is there a function that I could use?

采纳的回答

Walter Roberson
Walter Roberson 2013-12-3
cellfun(@numel, X)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by