extracting the nth multiple rows of a large matrix to create a submatrix
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi. Please i have a large matrix a=(1290 x 2) and i want to extract rows in multiple of 5 to create a new matrix. For example, a new matrix x, should be made of, the 5th row,10th row,15th row and so on, of matrix a. Please help me, I am new to MATLAB. Thanks
댓글 수: 0
답변 (2개)
madhan ravi
2018년 12월 5일
편집: madhan ravi
2018년 12월 5일
Simpler and easier:
x = a(5:5:end,:) % edited after all the comments
댓글 수: 4
Image Analyst
2018년 12월 5일
And (should be obvious, but evidently she's a beginner), to create the x she asked for:
x = a(5:5:end,:)
Kevin Chng
2018년 12월 5일
try, let say a is your matrix(1290x2)
a(1:5:1290,:)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!