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!

 Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 12 Juil 2015
Modifié(e) : Azzi Abdelmalek le 12 Juil 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)

Plus de réponses (0)

Catégories

En savoir plus sur Operators and Elementary Operations dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by