Please solve the following question in Maltab and follow the directions in the f
ID: 3891354 • Letter: P
Question
Please solve the following question in Maltab and follow the directions in the following picture. Your code should be able to reproduce the test functions.
Homework Problem 1: Temperature Conversion Create a function that converts temperature from Fahrenheit to Celsius. Name the function convertTempFtoC and name the input argument TF and the output TC. Here TF will be the temperature in Fahrenheit that is read into the function and TC will be the converted temperature in Celsius. Note that there can never be a temperature below -273.15 C (absolute zero), which must be incorporated into your function as an invalid input Your code should be able to reproduce the following test cases: >> convertTempFtoC (32) ans = 0 >> convertTempFtoC (212) ans = 100 >> convertTempFtoc (-500) ans NaNExplanation / Answer
function c = convertTempFtoC(f)
c=(f-32)*(5/9)
if c<-273.15
c=NaN
end
The code has input a temperature f in farenhiet and will convert according to the formula