How tor reshape an array

1 view (last 30 days)
Molepo Alfred
Molepo Alfred on 2 Aug 2021
Edited: Matt J on 2 Aug 2021
%How can I reshape A to obtain B
A=[1 0 1 1 0 1 0 1 0;1 1 0 1 0 1 0 1 1;1 1 0 1 1 1 0 0 0];
B=[1 0 1;1 0 1;0 1 0;1 1 0;1 0 1;0 1 1;1 1 0;1 1 1;0 0 0];

Accepted Answer

Matt J
Matt J on 2 Aug 2021
Edited: Matt J on 2 Aug 2021
B=reshape(A.',3,[]).'

More Answers (0)

Categories

Find more on Resizing and Reshaping Matrices in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!