Question: I need help with steps 10-12 on this MATLAB script. Following the discussion on using linear interpolation and regression to compute a missing value from
I need help with steps 10-12 on this MATLAB script.
Following the discussion on using linear interpolation and regression to compute a missing value from a dataset, your group will write a program to decide which method to use and then compute the missing value. Assume the spreadsheet is in the Current Folder and is titled banana_jams.xlsx.
Steps
1) Prompt the user to import a 2 column Excel spreadsheet
2) Ask the user if the first column is the independent data (x-data) a. If yes i. Save the first column as the independent data (x-data) ii. Save the second column as dependent data (y-data) b. If no i. Save the second column as the independent data (x-data) ii. Save the first column as the dependent data (y-data)
3) Explain to the user, using disp or frpintf, that their data is going to be plotted, but only after we have a little more information
4) Prompt the user to input information regarding what the independent data (x-data) represents
5) Prompt the user to input information regarding what the dependent data (y-data) represents
6) Plot the data using proper formatting rules and the information from steps (4) and (5) to form labels for the abscissa and ordinate
7) Use a menu to prompt to: a. Explain that we are now going to select the correct method for predicting future values b. Explain when linear interpolation or linear regression are valid based on the rules from lecture c. Offers linear interpolation and linear regression as the only two options
8) Close the plot
9) Prompt the user to input a value of the independent data (x-data) for which they would like to compute a companion value of the dependent data (y-data)
*10) Using the method selected in step (7c), and the value identified in step (9), compute the dependent data (y-data) data point
*11) Display the computed/inferred data point back to the user in a text string that provides context.
*12) Create a new plot with all of the data AND the dependent value computed in step (10), include a legend to differentiate between the two datasets (original and computed value)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
