Spectral radius of 4×4 matrices

9 ビュー (過去 30 日間)
Sunday Aloke
Sunday Aloke 2025 年 4 月 17 日
編集済み: Torsten 2025 年 4 月 17 日

I want to find the Spectra redius of the matrices below but I kept running into problem. syms a b c d e f g F = [0 0 0 a; 0 0 0 b; 0 0 0 c; e f g 0]

syms q r s t u V = [q 0 0 0; r s 0 0; 0 0 t 0; 0 0 0 u]

Vi = inv(V) % calculate inverse of V

K = F*Vi % compute the next generation matrix

 eigenvalues= eig(K) % Find the eigenvalues of \(K\)

abs_eigenvalues = abs(eigenvalues) % Compute the absolute values of the eigenvalues.

spectral_radius = max(abs_eigenvalues) %Find the maximum absolute eigenvalue. Error It's show fatal error

採用された回答

Paul
Paul 2025 年 4 月 17 日
Hi Sunday,
The code runs without error (after defining h) here on Answers using 2024b. You're seeing a different result in 2021a?
syms a b c d e f g h % have to define h
F = [0 0 0 a; 0 0 0 b; 0 0 0 c; e f g h]
F = 
syms q r s t u
V = [q 0 0 0; r s 0 0; 0 0 t 0; 0 0 0 u]
V = 
Vi = inv(V) % calculate inverse of V
Vi = 
K = F*Vi % compute the next generation matrix
K = 
eigenvalues= eig(K) % Find the eigenvalues of \(K\)
eigenvalues = 
abs_eigenvalues = abs(eigenvalues) % Compute the absolute values of the eigenvalues.
abs_eigenvalues = 
spectral_radius = max(abs_eigenvalues) %Find the maximum absolute eigenvalue. Error It's show fatal error
spectral_radius = 
  2 件のコメント
Sunday Aloke
Sunday Aloke 2025 年 4 月 17 日

Thank you. There no h in the F-matrix.

Torsten
Torsten 2025 年 4 月 17 日
編集済み: Torsten 2025 年 4 月 17 日
There no h in the F-matrix.
The code also works under R2024b if you replace h by 0 in the F-matrix.
Or you could use
spectral_radius = subs(spectral_radius,h,0)
as last command in the code from above.

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by