Cell contents assignment to a non-cell array object.
이전 댓글 표시
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
답변 (1개)
per isakson
2014년 3월 23일
편집: per isakson
2014년 3월 23일
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.
카테고리
도움말 센터 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!