Converge a 1x30 row vector to a 3x10 matrix
조회 수: 2 (최근 30일)
이전 댓글 표시
Suppose I have the following
z = [1:30]
Now I want to create a 3x 10 matrix. Where the entries in the first row are the first 10 values. In the second row entries 11:20 and in the third row 21:30
댓글 수: 2
채택된 답변
Wietze Zijpp
2022년 4월 5일
편집: Torsten
2022년 4월 5일
댓글 수: 1
Voss
2022년 4월 6일
"the entries in the first row are the first 10 values. In the second row entries 11:20 and in the third row 21:30"
If you want the order like that, you have to do it differently:
z = 1:30;
mymat = reshape(z,3,10)
mymat = reshape(z,10,3).'
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!