Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help on this ( Matlab ) Writing a function polyno_least_squares.m that implements the least squares method to approximate a data set in terms of
Need help on this (Matlab)
Writing a function polyno_least_squares.m that implements the least squares method to approximate a data set in terms of a polynomial model of degree M. The function should be of the form
function [a,err] = polyno_least_squares(xi,yi,M)
Hint: We can compare the results of our least squares implementation with the output of the Matlab function polyfit() and polyval()
Also note some notes for this problem:
Input: xi: vector of nodes xi-[xi(1) yi: vector of data points yir(yi (1) M: degree of the polynomial model xi(N)] yi (N) corresponding to [xi (1) xi (N) (x) = a (1) + a(2) z + 013)22 + . . . + a(M+1)2.M Output a: vector of coefficients representing the polynomial (1), i.e., a-[a( 1) . . . err: error between the model and the data in the 2-norm a(M+1) i=1 ao yo B- eman : tive )emi op1 B 1' NVERTIBLE Rmnk -noCi (x): and %(x)= olei X 2. DATA amdmonot B invatih me Wen (if B in invalihhStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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