How to multiplicate two block matrices with following conditions?

조회 수: 2 (최근 30일)
sn at
sn at 2017년 2월 14일
편집: sn at 2017년 2월 14일
I have a block diagonal matrix P with size 500*500 like this
P=[A 0 0
0 A 0
0 0 A...
... ];
each element A on the diagonal is a (m*n) matrix and there are T number of these matrices. (i.e. There are T elements on the diagonal and T is a large number like 500) I want to multiply each diagonal element(which is a matrix), with one of the elements of another block matrix V that is like this:
V=[B1;B2;...,BT]
%there are again so many Bi; (T=500);
%Each Bi is a (n*1) vector
Each A on the diagonal should be multiplied to the corresponding B.
In other words we want to calculate a block by block multiplication. One block of matrix P is multiplied by the corresponding block of V. Although A is (m*n) and Bi is (n*1), but when we do P*V, it gives this Error: "Inner matrix dimensions must agree."
  댓글 수: 2
James Tursa
James Tursa 2017년 2월 14일
"... I want to multiply each diagonal element(which is a matrix), with each one of the elements of another block matrix ... "
"... There exists one A for each B ..."
So, which is it? Multiply each A by each B, or multiply only one A for each B? Can you write down in pseudo-code what the result would look like?
sn at
sn at 2017년 2월 14일
Multiply each A by each B, But there are 500 of these pairs A and Bi.
the answer will almost be like this:
[y1;y2;...;y500] in which yi=A*Bi.
A is (m*n) and each Bi is n*1;
There will be 500 matrices yi which are (m*1) each.

댓글을 달려면 로그인하십시오.

답변 (1개)

sn at
sn at 2017년 2월 14일
편집: sn at 2017년 2월 14일
I found a file named block diagonal multiplication by David Holdaway in File Exchange. This function is Used for multiplying large block diagonal matrices with matrices / vectors. I think I will need this.
 

카테고리

Help CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by