How to split a 2xN matrix into multiple 2x2 matrices?
2 views (last 30 days)
Show older comments
How to split a 2xN matrix into multiple 2x2 matrices? and multiply them.
0 Comments
Accepted Answer
Dyuman Joshi
on 19 Mar 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 Comments
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!