How get the maximal positive root of polynomial?

2 ビュー (過去 30 日間)
Asatur Khurshudyan
Asatur Khurshudyan 2016 年 2 月 4 日
I have such a function which computes positive roots of 8th order polynomial.
function res = lambdazero1( l, a )
p = [-2 * l^4, 0, l^4 * (3 * a^2 - 2 * l^2 + 3), 0, 0, 0, l^2 * ( l^2 -3 * a^2 + a^6 * ( l^2-3 ) ), 0, 2 * a^6];
sol = roots(p);
res = sol(imag(sol) == 0 & sol > 0);
end
It turns out that for some values of "l" and "a" it has several positive roots. Any idea how to get the maximal positive root?
Many thanks in advance.

採用された回答

Torsten
Torsten 2016 年 2 月 4 日
Add
res = max(res)
in your code from above.
Best wishes
Torsten.
  1 件のコメント
Asatur Khurshudyan
Asatur Khurshudyan 2016 年 2 月 4 日
Simple and great! Thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePolynomials についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by