필터 지우기
필터 지우기

convert matrix to vector in a loop

조회 수: 2 (최근 30일)
Elahe Karimi
Elahe Karimi 2019년 6월 5일
댓글: Elahe Karimi 2019년 6월 5일
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

채택된 답변

Dennis
Dennis 2019년 6월 5일
편집: Dennis 2019년 6월 5일
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
Elahe Karimi
Elahe Karimi 2019년 6월 5일
thank you so much.it works.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by