Azzera filtri
Azzera filtri

How do i manipulate matrix in form given below??

1 visualizzazione (ultimi 30 giorni)
1 2; 3 4; 5 6; 7 8;
as
1 2 3 4; 5 6 7 8;

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 18 Ott 2013
Modificato: Azzi Abdelmalek il 18 Ott 2013
A=[1 2; 3 4; 5 6; 7 8]
BB=reshape(A',4,[])'
  3 Commenti
Azzi Abdelmalek
Azzi Abdelmalek il 18 Ott 2013
Modificato: Azzi Abdelmalek il 18 Ott 2013
Please copy and paste the code
A=[1 2; 3 4; 5 6; 7 8]
BB=reshape(A',4,[])'
The result
>>BB =
1 2 3 4
5 6 7 8
%or maybe you want this
A=[1 2; 3 4; 5 6; 7 8]
BB=reshape(A',[],2)'
Paranshu
Paranshu il 18 Ott 2013
It was really helpfull..thanks

Accedi per commentare.

Più risposte (1)

Andrei Bobrov
Andrei Bobrov il 18 Ott 2013
reshape(a',size(a))';

Categorie

Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by