extracting the nth multiple rows of a large matrix to create a submatrix

3 次查看(过去 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

回答(2 个)

madhan ravi
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
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
Kevin Chng 2018-12-5
try, let say a is your matrix(1290x2)
a(1:5:1290,:)

类别

Help CenterFile Exchange 中查找有关 Read, Write, and Modify Image 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by