Write a user-defined function [a3, a2, a1, aº] CubicRegression (x,y) that uses the cubic least-squares regression approach to find the third-degree polynomial that best its a set of data. The coefficients a3, a2, a1, a are found by expressing the appropriate 4 x 4 system of equations in matrix form and solving by "\" in MATLAB. The function also should return the plot of the data and the best cubic polynomial it. Find the value of [a3, a2, al, ao] for the following data. X 0 0.4 0.8 1.2 1.6 = y 2.9 3.1 3.56 4.6 6.7

Advanced Engineering Mathematics
10th Edition
ISBN:9780470458365
Author:Erwin Kreyszig
Publisher:Erwin Kreyszig
Chapter2: Second-order Linear Odes
Section: Chapter Questions
Problem 1RQ
icon
Related questions
Question

H1.

 

Write a user-defined function [a3, a2, al, a0] CubicRegression(x, y) that uses the cubic
least-squares regression approach to find the third-degree polynomial that best its a set of data. The
coefficients a3, a2, a1, a are found by expressing the appropriate 4 x system of equations in
matrix form and solving by "\" in MATLAB. The function also should return the plot of the data and the
best cubic polynomial it. Find the value of [a3, a2, al, a0] for the following data.
X
0
0.4
0.8
1.2
1.6
y
2.9
3.1
3.56
4.6
6.7
Transcribed Image Text:Write a user-defined function [a3, a2, al, a0] CubicRegression(x, y) that uses the cubic least-squares regression approach to find the third-degree polynomial that best its a set of data. The coefficients a3, a2, a1, a are found by expressing the appropriate 4 x system of equations in matrix form and solving by "\" in MATLAB. The function also should return the plot of the data and the best cubic polynomial it. Find the value of [a3, a2, al, a0] for the following data. X 0 0.4 0.8 1.2 1.6 y 2.9 3.1 3.56 4.6 6.7
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Advanced Engineering Mathematics
Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated
Numerical Methods for Engineers
Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education
Introductory Mathematics for Engineering Applicat…
Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY
Mathematics For Machine Technology
Mathematics For Machine Technology
Advanced Math
ISBN:
9781337798310
Author:
Peterson, John.
Publisher:
Cengage Learning,
Basic Technical Mathematics
Basic Technical Mathematics
Advanced Math
ISBN:
9780134437705
Author:
Washington
Publisher:
PEARSON
Topology
Topology
Advanced Math
ISBN:
9780134689517
Author:
Munkres, James R.
Publisher:
Pearson,