I have this code in matlab
b = 0.25*ones(4)
a = [0 1 1 1 ; 1/3 0 0 0 ; 1/3 0 0 0; 1/3 0 0 0]
m = .85*a + .15*b
v = [1/4 1/4 1/4 1/4]
m^1e308*v'
m^1e308*v' so quickly? it should mutiply the
matrix 1e300 times, but it probably do some other calculation,
what is it?why does m^1e309*v' gives :
ans =
NaN
NaN
NaN
NaN
how can I see what m^inf is without using symbolic variables?
How does matlab run
m^1e308*v'so quickly?
I can't tell you what the internals of Matlab are doing, but note that in general, A^n can be done in O(log n) time, not O(n) time.
For example, A^16 = (((A^2)^2)^2)^2.
You can also use the eigendecomposition to turn this into scalar powering, i.e. if A = U*V*U', then the power is U * V^N * U', where V is a diagonal matrix.
why does
m^1e309*v'giveNaN?
Double-precision cannot represent 1e309.
how can I see what
m^infis without using symbolic variables?
Use the eigendecomposition described above. If any of the eigenvalues are smaller than 1, they will go to 0, if any of them are greater than 1, they will go to infinity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With