convert matrix to vector in a loop

3 Ansichten (letzte 30 Tage)
Elahe Karimi
Elahe Karimi am 5 Jun. 2019
Kommentiert: Elahe Karimi am 5 Jun. 2019
Hello
I have a matrix with (144x10). I want to put 4 rows in the first row together as a vector and move it to a new matrix.(rows,40) Then put 4 next rows together as vectors and put them in a new matrix until the end in the same way.
a matrix:
(row1,40)
(row1,40)
(row1,40)
(row1,40)
(row1,40)
(row1,40)
.....
.....
please help me
thank you

Akzeptierte Antwort

Dennis
Dennis am 5 Jun. 2019
Bearbeitet: Dennis am 5 Jun. 2019
Please check if this works for you:
A=randi(100,144,10); %matrix of size (144,10)
B=reshape(A',40,36);
B=B';

Weitere Antworten (0)

Kategorien

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by