Question: Develop a Matlab function myCubicFit that calculates the coefficients through of the cubic polynomial that best fits given data points . The input arguments to

Develop a Matlab function myCubicFit that calculates the coefficients through of the cubic polynomial that best fits given data points . 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 a four-element column vector a that contains the values of through , and the error of the fit E defined as the sum of the squares of the residuals. Do NOT use any Matlab build-in functions to solve the required system of linear equations. Instead use myGaussJordan from Module 2. Use Matlab's ' operator to calculate the transpose of a matrix and * to calculate the product of matrices. Inside the function check that the length of the vectors x and y is the same. If not, display an error message, set the vector a and E to realmax() and exit the function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!