how can I calculate A^n when n is a symbolic positive integer?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Songbai Jin
am 23 Jan. 2023
Kommentiert: Songbai Jin
am 25 Jan. 2023
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 Kommentare
Akzeptierte Antwort
Walter Roberson
am 24 Jan. 2023
Bearbeitet: Walter Roberson
am 24 Jan. 2023
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 Kommentare
Siehe auch
Kategorien
Mehr zu Symbolic Variables, Expressions, Functions, and Preferences finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!