Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Matlab handles Polynomials

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "Matlab how to deal with polynomials", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "Matlab how to deal with polynomials" this article.

I. the establishment of polynomials

For polynomials, the coefficients of the polynomials are stored in the vector in descending order, which must be arranged from high to low. For example, polynomials can be represented by coefficient vectors. The polynomial is transformed into the polynomial coefficient vector problem, and the missing power in the polynomial should be filled with 0.

Convert a vector to a polynomial by ploy2sym ()

If the root of a polynomial is established, you can use ploy () to create the polynomial

2. Evaluation and Root of Polynomials

1. Polynomial evaluation

Ployval (): calculated in terms of elements in an array or matrix

Y=polyval (pforce x) calculates the function value of the polynomial coefficient vector p at x

Ployvalm (): calculated in matrix

two。 Finding the root of polynomial

Roots ():

Multiplication and division of polynomials

Conv () performs multiplication operations on polynomials, and its calling format is c=conv (aforce b), where an and b are coefficient vectors of polynomials. This function realizes the convolution of vectors an and b, which is algebraically equivalent to polynomial a multiplied by polynomial b, where c is the coefficient vector of the polynomials produced by multiplication.

Derivation and integral of Polynomials

Polyder (p): the derivation of a polynomial with coefficients of vector p

Polyder (aQuery b): derive the product of polynomials with vectors an and b as coefficients

[Q _ direction d] = ployder (b ~ a): returns the derivative of a polynomial with a coefficient divided by the quotient of a polynomial with a coefficient, expressed in the format Q _ hand _ d

Ployint (pforce k): returns the integral of a polynomial with a coefficient of vector p, with an integral constant of k

Polyint (p): the integral constant is 0

5. Polynomial expansion

Rational polynomials are represented by their numerator polynomials and denominator polynomials, and the function residue () can expand the ratio of polynomials in partial time, or express a partial fraction in terms of the ratio of polynomials.

[r] p ~ p ~ k] = residue (b ~ a): find the fractional expansion of the ratio of the polynomials b _ stroke a, the return value of the function r is the remainder, p is the pole of the partial fraction, k is the constant term.

VI. Fitting of polynomials

The function polyfit () uses the least square method to fit the given data and obtains the coefficients of the polynomial. The method of calling this function is: p=polyfit (x _ pencil y ~ n). The polynomial of degree n is used to fit the data x and y, and the polynomial with p as the coefficient is obtained. This function minimizes the minimum mean square error of p (x) and y.

VII. Interpolation

1. One-dimensional polynomial interpolation: interp1 ()

two。 One-dimensional fast Fourier interpolation: interpft ()

3. Two-dimensional interpolation: image processing, visualization of data interp2 (x, y, and z): generates the interpolation function ytransif (x ~ y) through the initial data x, y, and z, and returns the value of (xi,yi) on the function f (x ~ y).

Or use interp2: the interpolation methods used by method can be "nearest", "linear", "spline" and "cubic", where linear interpolation is the default interpolation method.

The limit of the function

Use limit () to calculate the limit of a function

Y=limit (f): find the limit of the function when x approaches 0

Y=limit: when x approaches Changshu a, find the limit of the function f

Y=limit (freguency xrem a recorder left'): left limit

Y=limit (freguency xrem a recordright`): right limit

These are all the contents of the article "how Matlab deals with Polynomials". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report