Menu

(Solved) : 1 Open Matlab 2 Create Function File Named Lab Right Click Crrent Folder Title Window B Se Q30192581 . . .

1. Open MATLAB 2. Create a Function file named Lab (a) Right click Crrent Folder title of that window (b) Select New File by moving mouse to that option (c) Click on Function in the pop-up menu (d) Type Lab05 in the highlight field and hit the enter key 3. Double click the Lab enter (that you just created) in the Current Folder window 4. Assume we have a system that tunes the temperature of a room. Given a vector (temp) which includes 5 positive temperatures values of the room between 0 and 100 degrees in Fahrenheit for 5 different days, we want to tune the temperature to a new value using the following rules: For the temperatures below 20 degrees, the new temperature is: 2*temperature+5. -For the temperatures above 70 degrees, the new temperature is: (temperature/2)-10. For the other temperature values, the new temperature is equal to the old one. Modify the Function file so that it: (a) Takes the temperature vector as input (b) Calculates the new temperature vector using find function (you dont have to use other structures such as if family) and the rules mentioned above. (c) Returns this new temperature vector as output 5. Call your function for numerous times (with different input vectors) to make sure that it is computing correct resulting temperatures each time. 6. Store the calculated temperatures in a variable: new temp Lab05(temp); 7. Provide a simple table using fprintf function to show the input vector and the corresponding new temperatures in two columns. 8. Once you get to this point, you should show your answers to your TA, and get checked off for this lab.

1. Open MATLAB 2. Create a Function file named Lab (a) Right click Crrent Folder title of that window (b) Select New File by moving mouse to that option (c) Click on Function in the pop-up menu (d) Type Lab05 in the highlight field and hit the enter key 3. Double click the Lab enter (that you just created) in the Current Folder window 4. Assume we have a system that tunes the temperature of a room. Given a vector (temp) which includes 5 positive temperatures values of the room between 0 and 100 degrees in Fahrenheit for 5 different days, we want to tune the temperature to a new value using the following rules: For the temperatures below 20 degrees, the new temperature is: 2*temperature+5. -For the temperatures above 70 degrees, the new temperature is: (temperature/2)-10. For the other temperature values, the new temperature is equal to the old one. Modify the Function file so that it: (a) Takes the temperature vector as input (b) Calculates the new temperature vector using “find” function (you don’t have to use other structures such as “if” family) and the rules mentioned above. (c) Returns this new temperature vector as output 5. Call your function for numerous times (with different input vectors) to make sure that it is computing correct resulting temperatures each time. 6. Store the calculated temperatures in a variable: new temp Lab05(temp); 7. Provide a simple table using “fprintf” function to show the input vector and the corresponding new temperatures in two columns. 8. Once you get to this point, you should show your answers to your TA, and get checked off for this lab. Show transcribed image text

Expert Answer


Answer to 1 Open Matlab 2 Create Function File Named Lab Right Click Crrent Folder Title Window B Se Q30192581 . . .

OR