MatLab code that satisfies the following prompt and restrictions whi.pdf

Mar. 30, 2023
1 of 1

MatLab code that satisfies the following prompt and restrictions whi.pdf

• 1. MatLab code that satisfies the following prompt and restrictions while being well commented thanks! Summary Lets recap what you need to do. I'm only partly sorry for writing a problem that needs a table of contents and summary. 1. Filter outliers from your data set. 2. Compute the linear regression on your filtered data set. 3. Compute the R2 value from your filtered data and your linear regression function. Here is the function specification. Name: linearRegression Inputs: 1. x-values of the data set 2. y-values of the data set Outputs: 1. Filtered x-values (i.e. the input x-values but without the outlier points), sorted from smallest to largest 2. Filtered y-valeus (i.e. the input y-values but without the outlier points), sorted from smallest to largest 3. Slope from the linear regression ( m in f(x)=mx+b ) 4. Intercept from the linear regression (b in f(x)=mx+b ) 5. Rsquared value begin{tabular}{|l|ll} 1 & function [fx,fY, slope, intercept, Rsquared] = linearRegression (x,y) 2 & % inearRegression Computes the linear regression of a data set 3 & % & Compute the linear regression based on inputs: 4 & % & 1. x:x-values for our data set 5 & % & 2. y:y- values for our data set 6 & % & 7 & % & Outputs: 8 & % & 1. fX:x-values with outliers removed 9 & % & 2. fY:y-values with outliers removed 10 & % & 3. slope: slope from the linear regression y=mx+b 11 & % & 4. intercept: intercept from the linear regression y=mx+b 12 & % & 5. Rsquared: R2, a.k.a. coefficient of determination 13 & end{tabular} Code to call your function?