degree

Degree of Laurent polynomial

Since R2021b

Syntax

``deg = degree(P)``

Description

example

````deg = degree(P)` returns the degree of the Laurent polynomial `P`.If P(z) is a Laurent polynomial $P\left(z\right)=\sum _{k=m}^{n}{C}_{k}{z}^{k}$, where m and n are integers, the degree of P(z) is n-m.```

Examples

collapse all

Create two Laurent polynomials:

• $a\left(z\right)=z-1$

• $b\left(z\right)=-2{z}^{3}+6{z}^{2}-7z+2$

```a = laurentPolynomial(Coefficients=[1 -1],MaxOrder=1); b = laurentPolynomial(Coefficients=[-2 6 -7 2],MaxOrder=3);```

Multiply $a\left(z\right)$ and $b\left(z\right)$. Confirm the degree of the product is equal to the sum of the degrees of $a\left(z\right)$ and $b\left(z\right)$.

```ab = a*b; degree(ab)```
```ans = 4 ```
`degree(a)+degree(b)`
```ans = 4 ```

Input Arguments

collapse all

Laurent polynomial, specified as a `laurentPolynomial` object.

Output Arguments

collapse all

Degree of Laurent polynomial, returned as a nonnegative integer.

Version History

Introduced in R2021b