Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN MATLAB a ) Write a function readData which will read in a file called CTEvsT. x 1 s x and will create ( and
IN MATLAB a Write a function readData which will read in a file called CTEvsT. and will create and return two
vectors, one called which corresponds to above and one vector called CTE which corresponds to the
vector above. Print the vector and CTE to the command line.
b Write another function call fitQuadraticFtn. This function will take in the and CTE vectors of data,
will set up the A matrix, the vector and solve for the coefficient vector It can be shown that the equation
for finding is given as follows:
where are the coefficients of the quadratic function that
best fit the data given. This is called a leastsquares solution and was developed by Gauss.
The function fitQuadraticFtn will return the vector of coefficients and Print these out to the
command line.
c Write a function plotQuadraticFit which takes in the original data points T and CTE vectors along with
the coefficient vector and creates a plot which shows the original data plotted as symbols such as xs and
the smooth curve fit. Use pts to create the smooth plot of the quadratic fit. The final results should look
like Figure Display the plot.
Hint: My main program looks like the following. This tells you the function signatures and general structure
of the solution
CTE vs T Data
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