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

MATLAB Code Exercise 2 The wind chill factor (WCF) describes how cold it \"feels

ID: 3744112 • Letter: M

Question

MATLAB Code

Exercise 2 The wind chill factor (WCF) describes how cold it "feels for a given temperature T, in Fahrenheit, and a given wind speed V (in miles per hour). The equation for wind chill factor is: WCF = 35.7 + 0.6T-35.TV0.16 + 0.437 V0.16 Write a script that has three inputs: temp in Fahrenheit, minimum wind speed, and maximum wind speed. Use a for loop to compute and display the wind chill factor (WCF) using the given temperature over the wind speed range in increments of 5 miles per hour. For example, suppose the user inputs a temperature of 20 F, a minimum wind speed of 5 mph., and a maximum wind speed of 20 mph. The output of the program should look like this (use fprintf to insert your calculated values into the text) For a temperature of 20 degrees F The wind chill factor for a wind speed of 5 m.p.h. is: 12.6 degrees F The wind chill factor for a wind speed of 10 m.p.h. is: 8.5 degrees F The wind chill factor for a wind speed of 15 m.p.h. is: 5.9 degrees The wind chill factor for a wind speed of 20 m.p.h. is: 3.9 degrees F

Explanation / Answer

T = input('Enter temperature in Fahrenheit: ');
min_speed = input('Enter minimum wind speed: ');
max_speed = input('Enter maximum wind speed: ');

fprintf(' For a temperature of %d degrees F ', T)

for V=min_speed:5:max_speed
WCF = 35.7 + 0.6*T - 35.7*V^0.16 + 0.43*T*V^0.16;
fprintf('The wind chill factor for a wind speed of %d m.p.h. is: %.1f degrees F ', V, WCF)
end