Write a MatLab user-defined function that determines the coefficients of a cubic polynomial, ƒ(x)=a₂x³ + a₂x² + a₁x + a that best fits a given set of data points. The function should also calculate the overall error E. Name the function [a,Er] = CubPolFit(x,y), where the input arguments x and y are vectors with the coordinates of the data points, and the output argument a is a four-element vector with the values of the coefficients a3, a₂, a₁, a. The output argument Er is the value of the overall error. (a) Use CubPolFit to find the cubic polynomial that best fits the data in the rubber tension tests (see lecture slides): Curve fitting - polynomial regression - Example A tension test is conducted for determining the stress-strain be- havior of rubber. The data points from the test are shown in the figure, and their values are given below. Determine the fourth order polynomial that best fits the data points. Make a plot of the data points and the curve that corresponds to the polynomial. Strain € Stress o (MPa) Strain € Stress o (MPa) 0 0.4 0.8 1.2 1.6 2.0 2.4 0 3.0 4.5 5.8 5.9 5.8 6.2 2.8 3.2 3.6 4.0 4.4 4.8 5.2 5.6 6.0 7.4 9.6 15.6 20.7 26.7 31.1 35.6 39.3 41.5 40 36 Strain 6 6 2 (b) Write a program in a script file that plots the data points and the curve of the cubic polynomial that best fits the data.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Write a MatLab user-defined function that determines the coefficients of a cubic polynomial,
f(x)=a₂x³ + a₂x² + a₁x + a that best fits a given set of data points. The function should also
calculate the overall error E. Name the function [a,Er] = CubPolFit(x,y), where the input arguments x and
y are vectors with the coordinates of the data points, and the output argument a is a four-element vector
with the values of the coefficients a3, a₂, a₁, a. The output argument Er is the value of the overall error.
"
(a) Use CubPolFit to find the cubic polynomial that best fits the data in the rubber tension tests (see lecture
slides):
Curve fitting - polynomial regression - Example
A tension test is conducted for determining the stress-strain be-
havior of rubber. The data points from the test are shown in the
figure, and their values are given below. Determine the fourth
order polynomial that best fits the data points. Make a plot of
the data points and the curve that corresponds to the polynomial.
Strain €
0 0.4 0.8 1.2 1.6 2.0 2.4
Stress (MPa) 0 3.0 4.5 5.8 5.9 5.8 6.2
Strain €
Stress (MPa)
2.8 3.2 3.6
7.4 9.6 15.6 20.7
4.0 4.4 4.8 5.2 5.6 6.0
26.7 31.1 35.6 39.3 41.5
36
Strain
192
(b) Write a program in a script file that plots the data points and the curve of the cubic polynomial that
best fits the data.
Transcribed Image Text:Write a MatLab user-defined function that determines the coefficients of a cubic polynomial, f(x)=a₂x³ + a₂x² + a₁x + a that best fits a given set of data points. The function should also calculate the overall error E. Name the function [a,Er] = CubPolFit(x,y), where the input arguments x and y are vectors with the coordinates of the data points, and the output argument a is a four-element vector with the values of the coefficients a3, a₂, a₁, a. The output argument Er is the value of the overall error. " (a) Use CubPolFit to find the cubic polynomial that best fits the data in the rubber tension tests (see lecture slides): Curve fitting - polynomial regression - Example A tension test is conducted for determining the stress-strain be- havior of rubber. The data points from the test are shown in the figure, and their values are given below. Determine the fourth order polynomial that best fits the data points. Make a plot of the data points and the curve that corresponds to the polynomial. Strain € 0 0.4 0.8 1.2 1.6 2.0 2.4 Stress (MPa) 0 3.0 4.5 5.8 5.9 5.8 6.2 Strain € Stress (MPa) 2.8 3.2 3.6 7.4 9.6 15.6 20.7 4.0 4.4 4.8 5.2 5.6 6.0 26.7 31.1 35.6 39.3 41.5 36 Strain 192 (b) Write a program in a script file that plots the data points and the curve of the cubic polynomial that best fits the data.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Use of XOR function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education