How to delete every nth row?

28 vues (au cours des 30 derniers jours)
phlie
phlie le 28 Nov 2016
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?)

Réponse acceptée

the cyclist
the cyclist le 28 Nov 2016
Modifié(e) : the cyclist le 28 Nov 2016
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 commentaire
prakhar dutta
prakhar dutta le 18 Fév 2019
thank you

Connectez-vous pour commenter.

Plus de réponses (1)

Ramesha Silva
Ramesha Silva le 24 Avr 2020
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

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by