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
EBK MATLAB: AN INTRODUCTION WITH APPLIC
- Introductory Circuit Analysis (13th Edition)Electrical EngineeringISBN:9780133923605Author:Robert L. BoylestadPublisher:PEARSONDelmar's Standard Textbook Of ElectricityElectrical EngineeringISBN:9781337900348Author:Stephen L. HermanPublisher:Cengage LearningProgrammable Logic ControllersElectrical EngineeringISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
- Fundamentals of Electric CircuitsElectrical EngineeringISBN:9780078028229Author:Charles K Alexander, Matthew SadikuPublisher:McGraw-Hill EducationElectric Circuits. (11th Edition)Electrical EngineeringISBN:9780134746968Author:James W. Nilsson, Susan RiedelPublisher:PEARSONEngineering ElectromagneticsElectrical EngineeringISBN:9780078028151Author:Hayt, William H. (william Hart), Jr, BUCK, John A.Publisher:Mcgraw-hill Education,