MATLAB Answers

0

convert matrix to vector in a loop

Asked by Elahe Karimi on 5 Jun 2019
Latest activity Commented on by Elahe Karimi on 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

  0 Comments

Sign in to comment.

Tags

1 Answer

Answer by Dennis
on 5 Jun 2019
Edited by Dennis
on 5 Jun 2019
 Accepted Answer

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 Comment

thank you so much.it works.

Sign in to comment.