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!