I am looking for an efficient implementation of the following operation in MATLAB.
Assume that there is A = blkdiag(A_1,...,A_i,...,A_n)
and B = blkdiag(B_1,...,B_i,...,B_n)
. Assume there is some function of two blocks f(A_i,B_i)
and output variable F = blkdiag(f(A_1,B_1),...,f(A_i,B_i),...,f(A_n,B_n))
. Therefore, I am asking your help about how to accomplish this task without using loops.
In my case f(A_i,B_i) = U'*kron(A_i,B_i)*U'
for some matrix U
and n
is about 100. Blocks A_i
and B_i
are of equal size for all i. All help will be appreciated.