Q:

The Wind Chill Factor (WCF) measures how cold it feels with a given air temperature T (in degrees Fahrenheit) and wind speed V (in miles per hour). One formula for WCF is

0

 The Wind Chill Factor (WCF) measures how cold it feels with a given air temperature T (in degrees Fahrenheit) and wind speed V (in miles per hour). One formula for WCF is WCF = 35.7 + 0.6 T – 35.7 (V 0.16) + 0.43 T (V 0.16) Write a function to receive the temperature and wind speed as input arguments, and return the WCF. Using loops, print a table showing wind chill factors for temperatures ranging from -20 to 55 in steps of 5, and wind speeds ranging from 0 to 55 in steps of 5. Call the function to calculate each wind chill factor.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Ch5Ex37.m

% Print table of wind chill factors 

% Print column headers

fprintf('%45s\n ', 'Wind Speeds') 

for v = 0:5:55

 fprintf('%7d', v)

end

fprintf('\nTemp\n')

for t = -20:5:55

 fprintf('%3d', t)

 for v = 0:5:55

 fprintf('%7.1f',wcf(t,v))

 end

 fprintf('\n')

end

wcf.m

function outwc = wcf(t, v)

% Calculates the wind chill factor

% Format of call: wcf(temperature, wind speed)

% Returns 35.74 + 0.6215T - 35.75(V^0.16) + 0.4275T(V^0.16)

outwc = 35.74 + 0.6215 .* t - 35.75 .* (v.^0.16) + ...

 0.4275 .* t .* (v.^0.16);

end

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now