Question: Write a MATLAB program that accomplishes the following using vectorized code a. Creates an x vector with elements from 1 to 20 in steps of

 Write a MATLAB program that accomplishes the following using vectorized code

Write a MATLAB program that accomplishes the following using vectorized code a. Creates an x vector with elements from 1 to 20 in steps of 0.5, b. Creates a y vector from the equation y x3-2x2 +3x -1, c. Modifies the y vector by randomly adding or subtracting 0.7 to every element in the y vector, Fits a cubic equation through the data points given by the x and modified y vectors using least-squares approximation (Use your written Gaussian elimination code), Plots the (x, modified y) data points as red triangles and the cubic that was fit through these points, and Puts the cubic equation that was fit through the points as the title of the plot. (Don't forget to label the axes as well.) d. e. f. Note that the cubic that is fit through the points will be close to, but not necessarily exactly the same as, the equation that was used to create the original points in part (b)

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 Databases Questions!