Polynomial Anonymous function degree
13 次查看(过去 30 天)
显示 更早的评论
How can I find the degree of a given "anonymous function" like f=@(x) x^2+2x; given the functions are only polynomials?
1 个评论
采纳的回答
Walter Roberson
2019-4-27
Build a vector
X = realmax.^(1./(1:50));
Evaluate the function at X. The first result that is finite is probably the degree. However, it is possible for a polynomial with sufficiently large coefficients to generate an infinity "early", or for with sufficiently small leading coefficient to be "late" relative to this, so you should use that as a starting point to do more cross-checking.
3 个评论
Walter Roberson
2019-4-28
x^4 is a leading coefficient of 1 which is "suffiently small" in terms of what I wrote above.
Perhaps a slightly different X would help? You should analyze why this case fails to figure out what changes to make.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polynomials 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!