Question: Problem 4 (7 points) Develop a Matlab function myExpoFit that finds the best fit of the function f(z) be togiven data points (ri, vi) using
Problem 4 (7 points) Develop a Matlab function myExpoFit that finds the best fit of the function f(z) be togiven data points (ri, vi) using least squares regression. The input arguments to the function must be the two vectors x and y that contain the values of the data points. The output of the function shall be the two scalars b and m. To solve the required linear least squares regression, use your function myLinReg. Use problem 2 to help you debug your function. Insert Comment % , Breakpoints Run Run and Advance EDIT BREAKPOINTS RUI uments MATLAB Homework4 Editor - /Users/lambui/Documents/MATLAB/Home myLinReg.m xmyCubicFit.m Problem5.m function [a0_al-E] = myLinReg (x,y) polyfit ( x, y, 1); 2- 3 [a] %% residual finding ry-polyval (a,x); = Error i.e sum of square of residual E = sum (r."2); 7 8-a0 9- end 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
