plot all roots of a polynomial which has a interval coefficient

2 ビュー (過去 30 日間)
senhan yao
senhan yao 2021 年 3 月 24 日
コメント済み: senhan yao 2021 年 3 月 24 日
For example, if the polynomial is: p= s^3 + a*s^2 + s + 1 which a=[2,3].
How can plot all the roots of this polynpomial? I can only figure out the roots when 'a' is fixed.
  2 件のコメント
Rik
Rik 2021 年 3 月 24 日
Wouldn't that just mean you would have to find the roots in a loop? There is an analytical way to determine the roots, but that will be a pain to implement.
senhan yao
senhan yao 2021 年 3 月 24 日
Yeah,it seems very laborious. I can plot the roots when 'a' is fixed. I think maybe there is a method like below to solve this problem.
P=[1 2 1 1];
z=roots(p);
scatter(real(z),imag(z));

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

採用された回答

Rik
Rik 2021 年 3 月 24 日
I meant something like this.
N=200;
Z=NaN(N,3);
a=linspace(2,3,N);
for n=1:numel(a)
p=[1 a(n) 1 1];
z=roots(p);
Z(n,1:numel(z))=z;
end
h=plot(real(Z),imag(Z));
legend({'1','2','3'},'Location','NorthWest')
[h.Color]=deal('b','r','k');
  1 件のコメント
senhan yao
senhan yao 2021 年 3 月 24 日
This is what i want ! It works! Thank you!

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

その他の回答 (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