Cell contents assignment to a non-cell array object.
Afficher commentaires plus anciens
Hello, I am encountering the following errors in my MATLAB program:
- * * **COMMAND LINE**** * * *
Cell contents assignment to a non-cell array object.
Error in FileName (line 11) Comfort{count}='!!!';
- * * * **SCRIPT FILE**** * * * *
for count=1:1:20
C(count) = -50+200*rand(1);
K(count) = C(count)+273.15;
F(count) = C(count)*9/5+32; %converting celsius to fahrenheit
R(count) = C(count)*1.8+491.67;
if F(count)>32
if F(count)>55
if F(count)>70
if F(count)>90
if F(count)>105
Comfort{count}='!!!';
else
Comfort{count}='hot';
end
else
Comfort{count}='warm';
end
else
Comfort{count}='mild';
end
else
Comfort{count}='cold';
end
else
Comfort{count}='freeze';
end
end
for count=1:20
fprintf('\n %.0f %.0f %.1f %.2f %.1f %s\n', count,C(count), K(count), F(count), R(count), Comfort{count});
end
Réponses (1)
per isakson
le 23 Mar 2014
Modifié(e) : per isakson
le 23 Mar 2014
Add
clear('Comfort')
at the top of the script. Or better add
Comfort = cell( 1, 20 );
at the top. Most likely Comfort hold some old data of another type.
1 commentaire
Xi
le 25 Août 2014
clear('comfort') really helps!
Catégories
En savoir plus sur Graphics Object Properties dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!