To write:
A MATLAB program in a script file that calculates heat index
Answer to Problem 1P
Solution:
The calculated value of heat index is
Explanation of Solution
Given
The equation used by national weather service for the calculation of heat index
is given by,
Where,
►
►
Substitute the given values of temperature and relative humidity in the above equation.
Write the MATLAB program that calculates the heat index
MATLAB Code:
%MATLAB Program that calculates the heat index by using the given values of temperature and relative humidity.
Temp = input('Enter the temperature in deg F: ');%Temperature
RH = input('enter the relative humidity in percentage: ');%Relative humidity
HI = -42.379+2.04901523*Temp+10.14333127*RH-0.22475541*RH*Temp-6.83783*10^-3*Temp^2-5.481717*10^-2*RH^2+1.22874*10^-3*Temp^2*RH+8.5282*10^-4*Temp*RH^2-1.99*10^-6*Temp^2*RH^2;
fprintf('\nThe Heat Index Temperature is: %.0f\n',HI)
Save the MATLAB Script with the name, Chapter4_29864_4_1P.m in the current folder.
Execute the script by typing the script name at the command window to get the code that gives the relative heat index by using the given values of temperature and relative humidity.
Result:
Conclusion:
Therefore, the calculated value of heat index is
Want to see more full solutions like this?
Chapter 4 Solutions
MATLAB: An Introduction with Applications
- MATLAB: An Introduction with ApplicationsStatisticsISBN:9781119256830Author:Amos GilatPublisher:John Wiley & Sons IncProbability and Statistics for Engineering and th...StatisticsISBN:9781305251809Author:Jay L. DevorePublisher:Cengage LearningStatistics for The Behavioral Sciences (MindTap C...StatisticsISBN:9781305504912Author:Frederick J Gravetter, Larry B. WallnauPublisher:Cengage Learning
- Elementary Statistics: Picturing the World (7th E...StatisticsISBN:9780134683416Author:Ron Larson, Betsy FarberPublisher:PEARSONThe Basic Practice of StatisticsStatisticsISBN:9781319042578Author:David S. Moore, William I. Notz, Michael A. FlignerPublisher:W. H. FreemanIntroduction to the Practice of StatisticsStatisticsISBN:9781319013387Author:David S. Moore, George P. McCabe, Bruce A. CraigPublisher:W. H. Freeman