How tor reshape an array

1 Ansicht (letzte 30 Tage)
Molepo Alfred
Molepo Alfred am 2 Aug. 2021
Bearbeitet: Matt J am 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];

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by