similar matrix multiplication speed up
显示 更早的评论
Hi,
I need to multiply many times matrices of the same type. Is there a way to speed this up:
M1^m*M2^m*...
where Mi = expm(alpha(i)*P) P being a matrix (hermitian). Already all Mi are precalculated and the main calculation cost of my problem now is the long matrix multiplication through all i.
Thanks
采纳的回答
更多回答(3 个)
Teja Muppirala
2011-6-20
You can combine all of those multiplications into one expression using the properties of the matrix exponential.
Compare these 3 expressions:
P = rand(3);
P = P*P';
format long
% These are all the same
expm(2*P)^7*expm(4*P)^7*expm(5*P)^7
expm(14*P)*expm(28*P)*expm(35*P)
expm(7*(2+4+5)*P)
类别
在 帮助中心 和 File Exchange 中查找有关 Operators and Elementary Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!