convert matrix to vector in a loop

2 vues (au cours des 30 derniers jours)
Elahe Karimi
Elahe Karimi le 5 Juin 2019
Commenté : Elahe Karimi le 5 Juin 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

Réponse acceptée

Dennis
Dennis le 5 Juin 2019
Modifié(e) : Dennis le 5 Juin 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';
  1 commentaire
Elahe Karimi
Elahe Karimi le 5 Juin 2019
thank you so much.it works.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by