how to solve Conversion to cell from double is not possible

i have the following cell array F=
[710x1 double]
[711x1 double]
[711x1 double]
[713x1 double]
my objective is to know the number of elements in each cell array and finally get resul looks like
[710]
[711]
[711] ...
for this i used the following code
for i=1:length(F);
f(i)=numel(f{i,1});
end
but i get the Warning: Number of elements exceeds maximum flint 2^53-1.
The result may be inaccurate.
*Conversion to cell from double is not possible.*
Any solution Ps. Thanks!

 Accepted Answer

F={1;1:2;1:3;5:10}
f=zeros(numel(F),1);
for i=1:numel(f);
f(i)=numel(F{i});
end
f
Or simply
f=cellfun(@numel,F)

More Answers (0)

Categories

Find more on Operators and Elementary Operations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!