Plotting graph with Alpha and spectral radius

9 ビュー (過去 30 日間)
HAHA
HAHA 2021 年 1 月 10 日
編集済み: HAHA 2021 年 1 月 21 日
hello

採用された回答

Alan Stevens
Alan Stevens 2021 年 1 月 10 日
It works if you set i = 0.1:0.1:10. With i = 0; the inverse of S is full of Inf's.
  2 件のコメント
Alan Stevens
Alan Stevens 2021 年 1 月 10 日
You have to leave out i = 0. The following
A = [5 -1 0 0 0; -2 5 -1 0 0; 0 -2 5 -1 0; 0 0 -2 5 -1; 0 0 0 -2 5];
H = 0.5*(A+A');
S = 0.5*(A-A');
P_M=[];
alpha=[];
for i = [-0.5:0.1:-0.1 0.1:0.1:10] % leave out i = 0
alpha=[alpha i];
s_radius=norm(eig(inv(i.*eye(5)+S)*(i.*eye(5)-H)*inv(i.*eye(5)+H)*(i.*eye(5)-S)),inf);
P_M=[P_M s_radius];
end
plot(alpha,P_M), grid
xlabel('alpha'),ylabel('P M')
produces this for me:
Alan Stevens
Alan Stevens 2021 年 1 月 10 日
In a previous comment you wrote "Unfortunately there is the same error but anyway i think i should set it as i = -0.5:0.1:10 as alpha is in the open set of 0-10.", which is why I set alpha from -0.5. However, if you just start i from 0.1 you should be able to get an appropriate graph.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by