Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
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