Answered step by step
Verified Expert Solution
Link Copied!

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. x1sx and will create (and return) two
vectors, one called T(which corresponds to x above) and one vector called CTE (which corresponds to the
vector f above. Print the vector T and CTE to the command line.
b) Write another function call fitQuadraticFtn. This function will take in the T and CTE vectors of data,
will set up the A matrix, the f vector and solve for the coefficient vector c. It can be shown that the equation
for finding c is given as follows:
c=(ATA)-1(ATf) where c=[c1c2c3] are the coefficients of the quadratic function that
best fit the data given. This is called a least-squares solution and was developed by Gauss.
The function fitQuadraticFtn will return the vector of coefficients c1,c2 and c3. 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 c and creates a plot which shows the original data (plotted as symbols such as x's) and
the smooth curve fit. Use 100 pts to create the smooth plot of the quadratic fit. The final results should look
like Figure 2. 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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How can you use instant messaging safely on the job?

Answered: 1 week ago

Question

f. Did they change their names? For what reasons?

Answered: 1 week ago