Please do in Matlab and write a comments I- Write a program consisting of a scri
ID: 3748921 • Letter: P
Question
Please do in Matlab and write a comments I- Write a program consisting of a script (tempConvert.m) and a function (degF_to_CK.m). The script: . prompts the user to enter a number in degrees Fahrenheit. calls the function degF_to_CK and passes the temperature value to it. gets two returned values from the function: the temperatures in °C and K. prints a nice message such as: "72 degree F is equal to 23degree Celsius and 296Kelvin." Receives the temperature in F as input argument. returns the two temperatures in C and K back to the script. The function: . Converts it to degrees C using the relation: C (F-32) 5/9 .Converts the temperature to K using the relation: K-C+273.15
Explanation / Answer
function [C, K] = degF_to_CK(F)
C = (F - 32) * 5 / 9;
K = C + 273.15;
end
F = input("F = ");
[C, K] = degF_to_CK(F);
C
K
}%
% Hit the thumbs up if you are fine with the answer. Happy Learning!