VOOZH about

URL: https://www.geeksforgeeks.org/matlab/polynomials-in-matlab/

⇱ Polynomials in MATLAB - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Polynomials in MATLAB

Last Updated : 9 May, 2022

A polynomial is an expression that is made up of variables, constants, and exponents, that are combined using mathematical operations such as addition, subtraction, multiplication, and division (No division operation by a variable). Polynomials in MATLAB are represented as row of a vector containing coefficients ordered by descending powers. 

For example, the equation G(x) = 2x4 + 3x3 - 4x + 1 could be represented as gfg = [2 3 -4 1]. For evaluating Polynomials we use function polyval( ), It evaluates the polynomial gfg at each point in x.

Example 1:

Output:

👁 Image
 

Example 2:

Output:  

👁 Image
 

Example 3:

Output:

👁 Image
 
Comment