MATLAB: The cell with the max number of elements

cell array

I have 1×8 cell array and I want t get the cell with the max number of elements for example for the following cell array
I need the answer to be cell number 7 can I do this with function max?

Best Answer

>> c = {1 [1,2] [1,3] [1,2,4] [1,2,4,5] [1,6] [1,2,4,5,7] nan}
c =
[1] [1x2 double] [1x2 double] [1x3 double] [1x4 double] [1x2 double] [1x5 double] [NaN]
>> [~,x] = max(cellfun(@numel,c))
x =
7