How to delete every nth row?
28 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
phlie
le 28 Nov 2016
Réponse apportée : Ramesha Silva
le 24 Avr 2020
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?)
0 commentaires
Réponse acceptée
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.
Plus de réponses (1)
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
0 commentaires
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!