This set of problems requires you to generate temperatureconversion tables. Use
ID: 3610388 • Letter: T
Question
This set of problems requires you to generate temperatureconversion tables. Use the golowing equations, which describe therelationships between temperatures in degrees Fahrenheit(Tf), degrees Celsius (Tc), degrees Kelvin(Tk), and degrees Rankine (tr),respecitvely. TF = TR - 459.67oR You will need to rearrange these expressions to solve some ofthe problems. A) Generate a table with the conversions from Fahrenheit toKelvin for values from 0oF to 200oF. Allowthe user to enter the increments in degrees F between lines. B) Generate a table with the conversions from Celsius toRankine. Allow the user to enter the starting temperature andincrement between lines. Print 25 lines in the table. C) Generate a table with the conversions from Celsius toFahrenheit. Allow the user to enter the starting temperature, theincrement between lines, and the number of lines for thetable.Explanation / Answer
convtemp - Convert from temperature units todesired temperature units
Syntax:
a = convtemp (v, ui, uo)
Description:
a = convtemp(v, ui, uo) computes the conversion factor fromspecified input temperature units, ui, to specified outputtemperature units, uo, and applies the conversion factor to theinput, v, to produce the output, a, in the desired units. v and aare floating-point arrays of size m-by-n. All of the values in vmust have the same unit conversions from ui to uo. ui and uo arestrings.
Supported unit strings are:
‘K’ Kelvin
‘F’ Degrees Fahrenheit
‘C’ Degrees Celsius
>> i=0:1:25;
>> a = convtemp(i, 'F','K')
a =
Columns 1 through 11
255.3722 255.9278 256.4833 257.0389 257.5944 258.1500 258.7056 259.2611 259.8167 260.3722 260.9278
Columns 12 through 22
261.4833 262.0389 262.5944 263.1500 263.7056 264.2611 264.8167 265.3722 265.9278 266.4833 267.0389
Columns 23 through 26
267.5944 268.1500 268.7056 269.2611
>> a'
ans =
255.3722
255.9278
256.4833
257.0389
257.5944
258.1500
258.7056
259.2611
259.8167
260.3722
260.9278
261.4833
262.0389
262.5944
263.1500
263.7056
264.2611
264.8167
265.3722
265.9278
266.4833
267.0389
267.5944
268.1500
268.7056
>> j=0:1:25;
>> b = convtemp(j, 'C','R')
b =
Columns 1 through 11
491.6700 493.4700 495.2700 497.0700 498.8700 500.6700 502.4700 504.2700 506.0700 507.8700 509.6700
Columns 12 through 22
511.4700 513.2700 515.0700 516.8700 518.6700 520.4700 522.2700 524.0700 525.8700 527.6700 529.4700
Columns 23 through 26
531.2700 533.0700 534.8700 536.6700
>> b'
ans =
491.6700
493.4700
495.2700
497.0700
498.8700
500.6700
502.4700
504.2700
506.0700
507.8700
509.6700
511.4700
513.2700
515.0700
516.8700
518.6700
520.4700
522.2700
524.0700
525.8700
527.6700
529.4700
531.2700
533.0700
534.8700
>> k=0:1:10;
>> c = convtemp(i, 'C','F')
c =
32.0000 33.8000 35.6000 37.4000 39.2000 41.0000 42.8000 44.6000 46.4000 48.2000 50.0000
>> c'
ans =
32.0000
33.8000
35.6000
37.4000
39.2000
41.0000
42.8000
44.6000
46.4000
48.2000
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.