how can I calculate A^n when n is a symbolic positive integer?
1 回表示 (過去 30 日間)
古いコメントを表示
A = [1/2,1/2,0,0;1/2,0,1/2,0;1/2,0,0,1/2;0,0,0,1]
syms n positive integer
A^n
This would not work because it got stuck and could never stop.
0 件のコメント
採用された回答
Walter Roberson
2023 年 1 月 24 日
編集済み: Walter Roberson
2023 年 1 月 24 日
syms N positive integer
[V, D] = eig(sym(A))
result = V*diag(diag(D).^N)/V
Note those are the matrix operations * and / not element by element operations
8 件のコメント
参考
カテゴリ
Help Center および File Exchange で Number Theory についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!