How to split a 2xN matrix into multiple 2x2 matrices?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hsin-Yen
am 19 Mär. 2024
Beantwortet: Dyuman Joshi
am 19 Mär. 2024
How to split a 2xN matrix into multiple 2x2 matrices? and multiply them.
0 Kommentare
Akzeptierte Antwort
Dyuman Joshi
am 19 Mär. 2024
%Assuming N is a multiple of 2
y = randi(10, 2, 16)
%Reshaping into 2x2 blocks
y = reshape(y, 2, 2, [])
z = y(:,:,1);
for k=2:size(y,3)
z = z*y(:,:,k);
end
z
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!