matrix to the power of a large number
9 views (last 30 days)
Show older comments
Hi, I want to calculate a Matrix like 1000 x 1000 (or 10000 x 10000) to the power of a large number like 10^6 /10^7. The Matrix consists of, for example 3 (2-8, case dependent) different vectors with 1000 (or 10000) entries, which are shifted 3 rows down for each vector block. The structure stays the same if I calculate Matrix^n; so instead of 1000^2 unknowns, I only have 3*1000; can I use the Matrix structure somehow?
Thanks a lot in advance! :)
A1 B1 C1 A(N-2) B(N-2) ....
A2 B2 C2 A(N-1) B(N-1)
A3 B3 C3 A(N) B(N)
A4 B4 C4 A1 B1 ...
0 Comments
Answers (3)
Harsha Medikonda
on 21 Aug 2015
I understand that you wish to calculate matrix to the power of a large number.
"mpower" function can be used to calculate matrix to the power of a number. Refer to the following documentation links for "mpower" and "power"
0 Comments
John D'Errico
on 21 Aug 2015
You do realize that you are probably wasting your time in this task?
If your matrix has elements in it that are as large as 2, that 2^1e7 is a number with 3 million plus decimal digits. Even in floating point format as a double, numbers of that size are not stored in MATLAB, except as inf. The result will overflow, and do so for even rather small exponents.
At best, you can use tools like my own HPF toolbox, or the symbolic toolbox.
If you insist on doing so, then it is easy enough to do. Of course, I assume you mean an element-wise power, since it makes no sense to raise a matrix that is not square to a power.
A = [1 2 3;4 5 6];
A.^100
A.^500
ans =
1 3.2734e+150 3.636e+238
1.0715e+301 Inf Inf
See that even a power as large as 500 is large enough to overflow some of those entries. The dynamic range of a double precision number is quite limited in this respect.
1 Comment
Walter Roberson
on 21 Aug 2015
They are using a square matrix with elements shifted along between the rows like toeplitz so I think they do want matrix power.
Walter Roberson
on 21 Aug 2015
Remember if you need to you can svd and raise the diagonal to the power.
2 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!