Write a MATLAB code to obtain the following. Keep your code commented whenever required. Copy your...

60.1K

Verified Solution

Question

Electrical Engineering

Write a MATLAB code to obtain the following. Keep yourcode commented whenever required. Copy your source code and commandwidow outcomes and screen shots of any plots in yoursolution.

Develop three functions for temperature-conversion.

  • Create a function called F_to_K that converts and returntemperatures in Fahrenheit to Kelvin and store results in‘F_to_K2.txt’.
  • Create a function called C_to_R that converts and returntemperatures in Celsius to Rankine and store results in‘C_to_R2.txt’.
  • Create a function called C_to_F that converts and returntemperatures in Celsius to Fahrenheit and store results in‘C_to_F2.txt’.

Use the following equations to achieve these conversions.

1 degree Fahrenheit =255.928 Kelvin

1 degree Celsius =493.47 Rankine

1 degree Celsius =33.8 degrees Fahrenheit

  • Write an appropriate MATLAB code to collectively call and testthese functions.
    • It should import data from ‘Tempr2.txt’ and convey it to eachof the above mentioned user defined functions. ‘Tempr2.txt’ isavailable on BlackBoard under the folder Final_Exam.
    • It should display on the command window one conversion tablefor each case while displaying first 20 inputs andconverted values.
    • It should also display a table on the command window, whichpresents the mean, median, variance and standard deviation valuesaccording to the following Table.

Measurements

       Input

Temperature

Output of

   F_to_K

Output of

   C_to_R

Output of

   C_to_F

Mean

Median

Variance

Standard

Deviation

Tempr2

70.00000054.000000-58.000000-4.000000-32.00000017.000000110.000000-39.000000102.000000-18.000000-28.00000035.00000040.00000019.000000-68.000000-30.000000-38.000000-21.000000-34.00000026.00000056.000000-8.00000033.00000043.00000012.000000-9.000000-22.000000-53.000000-9.00000013.000000-4.00000016.0000007.00000039.000000-27.000000-1.00000017.000000-14.00000019.000000-84.00000028.00000028.0000005.000000-13.000000-17.000000-80.00000060.00000037.000000-49.000000-69.000000-14.00000039.00000047.00000032.00000043.00000093.000000-80.00000028.0000002.000000-32.00000041.0000005.00000065.000000-47.000000-37.00000027.000000-39.00000011.000000-15.00000060.00000027.000000-15.000000-27.000000-15.000000125.0000003.000000-5.000000-5.00000081.000000-82.00000061.000000-31.000000-9.00000039.000000-42.00000026.0000001.000000-65.00000015.00000034.00000037.000000-23.0000004.00000036.00000032.000000-14.000000-59.00000019.00000021.00000080.000000-73.000000-13.00000027.000000-0.000000106.000000-13.000000-113.00000041.000000-65.00000071.00000025.000000-12.000000-44.00000098.00000020.000000-19.000000-30.000000-4.00000068.000000101.0000006.00000026.00000021.000000-77.00000012.000000-20.000000-16.000000-3.000000-140.000000-32.00000043.00000011.000000-21.000000-12.000000-49.000000-30.000000-24.000000-4.00000034.0000004.0000001.000000-37.00000054.00000017.00000033.00000016.00000045.00000081.000000-17.00000032.00000039.0000005.000000101.000000-44.000000-19.0000009.0000006.000000-6.000000-19.00000046.0000002.000000-35.00000091.00000051.00000079.0000004.000000101.00000051.000000-85.000000-58.00000034.000000-1.000000-2.00000059.00000090.00000025.00000011.000000118.0000004.000000-18.000000-25.000000-32.0000009.000000-38.000000-88.000000-59.00000027.00000060.00000065.000000121.000000-49.00000073.0000009.000000-18.000000-16.00000049.00000037.000000-85.00000056.00000046.000000-7.000000-44.000000-33.000000-57.0000002.000000-14.000000-11.00000016.000000-10.000000-80.000000-25.000000-21.000000-81.00000049.000000-103.00000026.000000-10.000000-13.00000037.000000-10.000000-6.000000-39.00000061.00000055.00000039.00000032.00000041.00000040.00000025.00000037.000000-30.0000006.00000033.000000-31.0000005.000000-4.00000067.00000029.00000060.00000036.00000055.0000000.00000011.000000-26.00000024.000000159.00000010.0000003.00000048.000000-73.00000061.000000-37.00000033.00000019.0000002.000000-31.00000026.00000061.00000039.00000075.000000-64.0000006.000000-63.00000011.00000032.000000-33.00000069.000000-19.00000036.000000-12.000000-33.000000-32.000000-68.00000081.000000-117.000000-60.000000-94.000000-62.000000-135.00000035.0000007.000000-47.000000-60.000000-61.000000-9.000000-96.00000025.0000001.000000-12.00000038.00000022.000000-12.0000007.000000-2.000000-26.00000061.00000065.0000009.000000-46.000000-54.00000018.000000-8.000000-36.00000012.000000-54.00000022.000000-75.000000-118.000000-5.000000-44.00000082.00000074.000000-26.000000-43.000000-6.000000-11.00000074.000000-12.00000065.00000067.000000131.000000-14.000000-19.00000089.000000-32.000000-86.0000009.00000030.000000-13.000000-13.000000-63.00000091.00000015.000000-22.00000025.00000047.000000-47.00000016.000000-19.00000088.00000013.000000-51.000000-1.00000027.000000110.0000007.00000034.00000065.00000030.000000-38.000000-3.000000-28.00000040.00000082.0000004.00000058.000000-30.00000013.000000-4.00000087.00000020.00000043.000000-12.000000-27.00000025.000000-36.000000-63.000000-10.00000085.000000-15.00000016.000000-25.000000-98.0000005.00000090.000000-12.000000-53.000000-45.00000023.000000-16.00000054.000000-9.000000-99.000000-17.00000041.00000056.00000069.00000055.00000059.000000100.00000082.00000014.000000-19.000000-9.00000040.00000065.000000-7.00000081.000000-31.000000-18.000000-14.000000-28.00000048.000000-4.00000098.0000005.00000098.000000-116.00000023.00000019.000000102.00000018.00000094.000000100.000000-26.000000-55.00000048.000000-36.000000-3.000000-24.00000010.00000035.00000041.00000012.000000-42.000000-37.00000020.000000-104.000000-54.000000-73.000000-11.00000029.000000123.0000005.000000-48.000000-18.00000028.00000056.000000-18.0000005.00000064.00000016.0000009.000000-12.000000-14.00000058.000000-22.0000003.000000-47.00000035.00000017.00000027.0000004.000000-32.0000001.000000-59.000000-12.000000120.00000089.00000048.00000027.00000046.00000024.00000052.00000065.000000-46.000000-5.0000004.000000-23.000000-45.00000069.00000038.000000-41.000000-48.00000026.000000-29.000000-55.000000-7.000000-37.00000047.000000120.000000-80.00000047.00000026.000000-37.00000053.000000-39.000000-89.000000-51.00000034.00000026.00000055.00000030.00000068.000000-95.000000-10.000000-13.0000002.00000058.000000-29.00000018.000000-91.000000-41.00000052.000000-82.00000076.000000-19.00000031.000000-54.00000043.0000005.00000068.000000-22.000000-32.000000-33.000000104.000000-11.000000-75.00000052.0000006.000000-13.00000031.00000049.000000-27.00000011.000000-11.000000-24.00000029.00000041.000000-64.00000061.00000012.000000-7.000000-74.000000-8.0000002.00000010.000000-17.00000051.00000083.00000067.000000-7.00000022.00000025.000000-26.0000004.000000-24.0000008.00000086.000000-4.000000-32.00000074.00000049.000000-21.000000-32.00000076.0000007.00000014.00000022.000000-26.00000059.000000123.000000-119.00000015.00000052.000000-35.0000009.00000014.000000-25.00000040.00000066.00000016.00000023.000000-22.00000061.0000000.00000027.00000064.000000-10.000000-5.00000010.000000-6.000000-58.00000029.000000-67.000000-10.000000-65.00000070.0000009.00000029.000000-8.00000084.000000-15.00000063.00000063.000000-21.00000026.00000011.000000111.000000-45.000000-74.00000021.000000-43.000000-24.00000022.000000-60.00000059.00000026.00000076.000000-11.00000051.000000-51.00000017.00000061.000000-27.0000009.00000087.000000-34.000000-51.00000052.0000004.000000-50.000000-40.00000022.00000017.000000-13.00000016.00000033.000000-32.000000-11.000000-31.00000072.000000-59.00000086.000000-23.0000005.00000053.00000042.000000-12.00000049.000000-54.00000074.00000063.0000006.00000025.00000054.000000-11.00000032.00000039.00000024.000000-66.000000-12.000000-94.000000-14.000000-34.0000000.00000024.00000047.000000-2.0000007.00000056.00000070.00000016.00000048.000000-31.00000084.000000-28.000000-33.00000032.0000002.000000-74.00000059.00000040.00000087.00000020.00000040.000000-53.00000098.000000124.000000-14.000000-30.00000055.000000-52.00000013.000000-2.00000046.000000-93.00000011.00000018.000000-84.000000-3.00000036.000000-59.000000-10.00000015.000000-21.00000084.00000043.000000-24.00000022.00000061.00000017.00000033.00000037.00000042.000000-61.000000-29.000000-13.000000-75.000000-65.00000023.00000023.00000051.00000023.000000-33.0000004.000000-31.00000048.000000-71.00000048.00000030.00000044.000000-24.00000015.0000003.000000-71.00000029.00000027.000000-32.00000067.000000-83.000000-16.000000-15.000000-31.000000-28.00000029.000000-39.0000008.000000-16.000000-1.000000102.000000-22.00000049.0000007.0000007.000000-90.00000056.00000013.000000-17.0000007.000000-0.00000097.000000-50.000000-23.00000018.00000098.00000018.00000061.00000043.00000041.00000069.000000120.00000012.000000-10.00000014.000000-10.000000-111.000000-1.00000013.000000-13.000000-6.00000067.0000009.0000004.000000-28.000000-23.000000-0.00000011.00000024.00000087.00000073.000000-55.00000093.000000-44.000000134.00000015.000000-17.000000-96.000000-15.00000082.000000-16.000000-18.000000-61.000000-54.000000-24.00000023.000000-98.00000038.000000-19.00000045.0000005.000000-17.00000030.00000030.000000106.000000-60.000000-30.000000-56.000000-24.000000-20.000000-17.000000-18.000000-21.000000-7.00000026.00000061.000000-13.00000096.00000049.00000066.000000-44.000000-86.00000021.00000022.000000-80.000000-69.00000023.00000057.00000073.000000-41.00000035.00000036.0000003.000000-48.000000-50.00000042.000000-79.000000-10.00000012.00000060.000000-13.000000-65.00000022.000000-31.00000094.000000-38.00000014.000000107.00000058.0000004.00000029.000000125.00000075.000000-61.00000014.00000058.000000-72.00000019.0000002.00000019.000000-35.000000-86.000000-49.00000099.000000-1.000000-43.00000078.00000051.000000-38.00000059.00000061.000000-34.00000032.000000-14.00000068.000000-58.000000-15.00000046.0000001.00000034.00000092.000000-16.000000-50.00000083.000000-17.00000021.000000-24.000000-73.000000-42.00000071.000000-16.000000-3.00000020.00000064.00000013.000000-8.000000-38.00000034.000000-99.000000-54.00000042.00000027.000000-59.00000032.00000028.000000-54.0000001.00000085.000000-20.000000-62.00000013.000000-23.000000-13.00000026.0000002.000000-14.000000-47.000000-36.000000-46.000000-25.00000093.00000012.000000-22.000000-1.00000017.00000019.00000021.00000060.000000-12.00000023.000000-26.000000-88.000000-24.00000076.000000-13.00000056.00000035.000000-25.000000101.00000049.00000050.000000-40.000000-27.00000037.00000065.0000004.00000091.000000-1.00000041.0000005.00000060.000000-11.0000003.000000-70.00000020.0000009.00000031.00000022.000000-28.00000038.000000136.000000-27.00000052.000000-24.000000-40.000000-51.00000034.0000007.00000049.000000-5.000000-54.000000-5.0000001.00000036.000000-56.000000-87.00000028.000000-34.000000-20.00000033.0000006.00000013.00000064.00000058.0000005.000000-22.000000-55.00000021.000000121.00000057.00000016.000000-50.000000-56.000000-22.000000-182.00000026.00000067.00000011.000000-11.00000073.000000

Answer & Explanation Solved by verified expert
3.7 Ratings (709 Votes)
matlab TreadtableTempr2txt FtoKt t325927315 CtoRt t95 49167 CtoFt t95 32 tTTempr2 tFKFtoKt tCRCtoRt tCFCtoFt TFKtablet120tFK120VariableNamestemperatureFahrenheittemperatureKelvin TCRtablet120tCR120VariableNamestemperatureCelsiustemperatureRankine TCFtablet120tCF120VariableNamestemperatureCelsiustemperatureFahreheit tmeanmeant    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students