Converting a matrix of other forms into one simple matrix - help

1 visualizzazione (ultimi 30 giorni)
Hi guys, I have 4x36x4 matrix and I wanted to make it into 16x36 matrix, is there anyway to do that?
Best regards, Ayubirad

Risposta accettata

Andrei Bobrov
Andrei Bobrov il 11 Set 2012
Modificato: Andrei Bobrov il 11 Set 2012
please read about the function reshape
A = randi(456,4,36,4); % Let the initial array
out = reshape(A,16,[]);
ADD (please read about the function permute)
out = reshape(reshape(A,size(A,1),[])',size(A,2),[])';
or
out = reshape(permute(A,[2 1 3]),size(A,2),[])';
  3 Commenti

Accedi per commentare.

Più risposte (0)

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by