Hello, I'm getting the following error:
- * ***COMMAND WINDOW***** * *In an assignment A(I) = B, the number of elements in B and I must be the same.
Error in C_B_HW_9 (line 22) Comfort(count)=('cold');
- * *This is the 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'); endendfor count=1:20 fprintf('\n %.0f %.0f %.1f %.2f %.1f %s\n', count,C(count), K(count), F(count), R(count), Comfort(count));end
Best Answer