How to delete every nth row?

109 次查看(过去 30 天)
I have a given matrix and I would like to delete every nth row. (Is there any particularity I have to keep in mind given that my matrix will generally not be a multiple of n?)

采纳的回答

the cyclist
the cyclist 2016-11-28
编辑:the cyclist 2016-11-28
If your matrix is A, then
A(n:n:end,:) = [];
will delete every nth row. Your matrix row count does not need to be evenly divisible by n.

更多回答(1 个)

Ramesha Silva
Ramesha Silva 2020-4-24
How to delete all even columns of A?
0.6000 0.4000 0.6000 0.8000 -1.0000
1.0000 2.0000 3.0000 4.0000 5.0000
0 0 0 0 -1.0000

类别

Help CenterFile Exchange 中查找有关 Denoising and Compression 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by