Filter löschen
Filter löschen

multiply each block of a matrix with another matrix

1 Ansicht (letzte 30 Tage)
bidlee devi
bidlee devi am 8 Feb. 2020
Kommentiert: bidlee devi am 13 Feb. 2020
Suppose we have
Matrix A of size 32*32
Matrix B of size 8*8.
How to multiply each block of 8*8 of A with B?
Thanks for the help! :)

Antworten (1)

David Hill
David Hill am 8 Feb. 2020
count=1;
for j=1:4
for k=1:4
out{count}=A((j-1)*8+1:j*8,(k-1)*8+1:k*8)*B;
count=count+1;
end
end
Your output is in a cell array.
  2 Kommentare
bidlee devi
bidlee devi am 10 Feb. 2020
Thank you, David.
bidlee devi
bidlee devi am 13 Feb. 2020
If we want the output in a matrix form that is in 32*32, how do we do that?
Thanks.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Operating on Diagonal Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by