How Can MATLAB Calculate Polynomial Coefficients for Given Points?

Click For Summary
SUMMARY

The discussion focuses on calculating polynomial coefficients using MATLAB for a quadratic function defined by four points. Users are tasked with creating a user-defined function that accepts points and computes coefficients a, b, c, and d by solving a system of linear equations. The specific points provided are (-2,-20), (0,4), (2,68), and (4,508), leading to the solution of a = 7, b = 5, c = -6, and d = 4. The conversation also explores the concept of a reverse polynomial evaluation function.

PREREQUISITES
  • Familiarity with MATLAB programming
  • Understanding of polynomial equations and coefficients
  • Knowledge of linear algebra concepts, specifically solving systems of equations
  • Experience with MATLAB's built-in functions for polynomial manipulation
NEXT STEPS
  • Research how to implement user-defined functions in MATLAB
  • Learn about MATLAB's 'polyfit' function for polynomial fitting
  • Explore methods for solving systems of linear equations in MATLAB
  • Investigate the use of MATLAB's 'polyval' function for polynomial evaluation
USEFUL FOR

Students, educators, and engineers working with MATLAB who need to compute polynomial coefficients from given data points, as well as anyone interested in numerical methods for solving polynomial equations.

George3
Messages
31
Reaction score
0

Homework Statement


`Suppose it is known that the graph of the function y= ax^2 +bx^2+cx+d passes through four given points (x_i,y_i), i = 1,2,3,4. Write a user defined function that accepts these four points as input and computes the coefficients a,b,c and d. The function should solve four linear equations in terms of the four unknowns a,b,c,and d. Test your function for the case where (x_i,y_i) = (-2,-20), (0,4), (2,68), and (4, 508), whose answer is a = 7, b = 5, c = -6, and d = 4.

Homework Equations


The Attempt at a Solution


Is there anything that can do something like a reverse polyval? Any ideas?
 
Last edited:
Physics news on Phys.org
Replace each pair x_i, y_i in the equation. You will have four equations with the unknowns a, b, c, d.
 

Similar threads

Replies
2
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 18 ·
Replies
18
Views
6K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K