degree

degree returns the degree of a polynomial

Syntax

d = degree(f,x)

Examples

With only 1 argument, the largest total degree is returned

sdpvar x1 x2
f = x1^2*x2^3 + x1^4;
degree(f)
ans =

     5

With two arguments, the degree w.r.t individual variables are returned

degree(f,[x1 x2])

ans =

     4     3

The lowest degree can also be extracted

 degree(x1^2*x2^3 + x1^4,[x1 x2],'min')

ans =

     2     0

Leave a Comment