Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The heat index Hf, calculate from the air temperature and relative humidity, is

ID: 3824208 • Letter: T

Question

The heat index Hf, calculate from the air temperature and relative humidity, is the apparent temperature felt by the body. An equation used by the National Weather Service for calculating the HI is given by: HI = -42.379 + 2.04901523T + 10.14333127R - 0.22475541TR - 6.83783 times 10^-3 T^2 - 5.481717 times 10^-2 R^2 + 1.22874 times 10^-3 T^2 R + 8.5282 times 10^-4 TR^2 - 1.99 times 10^-6 T^2 R^2 where T is the temperature in *F, and R is the relative humidity in integer percentage. Write a MALTAB program in a script file that displays the following chart of heat index for given air temperature and relative humidity in the Command Window.

Explanation / Answer

datasave=[];

for i=1:10

T=input('enter temperature:');

R=input('enter relative humidity in percentage:');

heatindex=(-42.379+(2.04901523*T)+(10.14333127*R)-(0.22475541*T*R)-(6.83783*T*T*0.001)-(5.481717*0.01*R*R)+(1.22874*0.001*T*T*R)+(T*R*R*0.0001*8.5282)-(1.99*0.000001*T*T*R*R));

datasave=[datasave;T R heatindex ];

end

fprintf('temperature relativehumidity heatindex ');

disp(datasave);

output:

temperature relativehumidity heatindex
3.0000 4.0000 0.7906
3.0000 9.0000 44.7932
3.0000 2.0000 -17.5424