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!

 Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 12 Jul. 2015
Bearbeitet: Azzi Abdelmalek am 12 Jul. 2015
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)

Weitere Antworten (0)

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by