MATLAB program
6. You are construeting a program to convert the specific heat of common materials from units of calories per gram degree Celsius to units of British thermal units per pound-mass degree Fahrenheit. A file named Spee? [ ?cllea. mal is available online. Place this file into your MATLAB directory. Following the housekeeping commands, use the load command to load the contents of this file into your workspace load Specifichoal mat ) 1. This will place the variable SpHoat into your workspace. Sphoat is a two column cell array containing the following initial compounds and associated specific heat values: Aluminum, 0.22; Calcium, 0.15 Gold, 0.031: Silicon, 0.17; Zinc, 0.093 Instruct the user to select a material from a menu or enter a new material name [see sample menu shownl. If the user closes the menu, issue a warning message and redisplay the menu until the user makes a correct choice MEND Choose a meta Gold Slicon Znc If the user chooses to enter a new material, the user should be prompted to enter the material name and the specific heat of the material in units of calories per gram degree Celsius. This new material should be stored in a new row at the bottom of the cell array with the original data. Once the new material has been entered, save the revised cell array variable to " Speciticlleat.mat .[Refer to the documentation files on the save command if you do not know how to do this.J Note that if you run the program again after this that Splleat will contain the newly added data when you load the variable from Speciticleat.mat For the compound either chosen or entered by the user, convert the specific heat value to units of British thermal units per pound-mass degree Fahrenheit. Display in the Command Window both values similar to the output shown below, using three decimal places for the values. The specitic heat of Gold in 0.031 cal/ (g deg C)x.xxx TU/ (lb dog t Ask the user if they wish to run the program again, using a menu. Repeat the program until the user chooses to terminate the program Test Case and Sample Output Enter a metal: Braas Enter 0.09 the specitic heat capacity ot Brass in cal/tg deg cy BTO/(LD deg E) 6. You are construeting a program to convert the specific heat of common materials from units of calories per gram degree Celsius to units of British thermal units per pound-mass degree Fahrenheit. A file named Spee? [ ?cllea. mal is available online. Place this file into your MATLAB directory. Following the housekeeping commands, use the load command to load the contents of this file into your workspace load Specifichoal mat ) 1. This will place the variable SpHoat into your workspace. Sphoat is a two column cell array containing the following initial compounds and associated specific heat values: Aluminum, 0.22; Calcium, 0.15 Gold, 0.031: Silicon, 0.17; Zinc, 0.093 Instruct the user to select a material from a menu or enter a new material name [see sample menu shownl. If the user closes the menu, issue a warning message and redisplay the menu until the user makes a correct choice MEND Choose a meta Gold Slicon Znc If the user chooses to enter a new material, the user should be prompted to enter the material name and the specific heat of the material in units of calories per gram degree Celsius. This new material should be stored in a new row at the bottom of the cell array with the original data. Once the new material has been entered, save the revised cell array variable to " Speciticlleat.mat .[Refer to the documentation files on the save command if you do not know how to do this.J Note that if you run the program again after this that Splleat will contain the newly added data when you load the variable from Speciticleat.mat For the compound either chosen or entered by the user, convert the specific heat value to units of British thermal units per pound-mass degree Fahrenheit. Display in the Command Window both values similar to the output shown below, using three decimal places for the values. The specitic heat of Gold in 0.031 cal/ (g deg C)x.xxx TU/ (lb dog t Ask the user if they wish to run the program again, using a menu. Repeat the program until the user chooses to terminate the program Test Case and Sample Output Enter a metal: Braas Enter 0.09 the specitic heat capacity ot Brass in cal/tg deg cy BTO/(LD deg E)