Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started