How to find degree of polynomial in Matlab?
Show older comments
Dear All, Good day! I am trying to find the degree of polynomial in MATLAB. I know it is possible in MuPAD by using degree(p). But couldn't find a way by using editor. Kindly help me on this. Thanks
Accepted Answer
More Answers (2)
Roger Stafford
on 30 Dec 2013
0 votes
Suppose you evaluate your polynomial, P(x), at a large number of equally-spaced values of x. Then if diff(P,n) exhibits a non-zero constant value (except of course for small round-off errors,) you can conclude that P has degree n. Moreover, that constant value is indicative of the coefficient of the highest degree term.
I would think however, that an inspection of whatever process is creating your polynomial should more easily tell you its degree.
Categories
Find more on Number Theory in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!