I am trying how to figure out how to do this problem using matlab if you could p
ID: 3812846 • Letter: I
Question
I am trying how to figure out how to do this problem using matlab if you could please leave comments in the code so I can follow your way of thinking would be apreciated. Thank you for your time.
Problem Description Use the following equations, which describe the relationships between temperatures in degrees TK TC 273.15 TF 39/5 TC +32 TR -TF 459.67 Write a function that generate a conversion table from Celsius to Kevin, to Fahrenheit, and to Rankine. Input the starting temperature, increments between lines, and the number of lines of the table to print out Example: Given starting TC of 0 degree Celsius, increments of 5 degree Celsius between lines, and a total of 4 lines in the table. Input are 10, 5,4] The output table should read: 0 273.1500 32.0000 491.6700 5.0000 278.1500 41.0000 500.6700 10.0000 283 1500 50.0000 509.6700 15.0000 288 1500 59.0000 518.6700Explanation / Answer
function print_temperature_table(start, step, n)
for i = 1:n
TC = start + (i-1)*step
TK = TC + 273.15
TF = (9/5)*TC + 32
TR = TF + 459.67
fprintf("%.4f %.4f %.4f %.4f ", TC, TK, TF, TR)
end
end
print_temperature_table(0, 5, 4)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.