Deleting specific Rows in a matrix
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
James
le 7 Avr 2014
Réponse apportée : Ondrej Budac
le 7 Avr 2014
Hi,
I have a matrix "A" that is 350x1 matrix, so it is a very large matrix. This matrix has about 40 rows that I want to remove. I know these rows and they are stored in another matrix "B", which is a 40x1 matrix. How do I delete the rows that are listed in matrix "B" from matrix "A"?
0 commentaires
Réponse acceptée
Joseph Cheng
le 7 Avr 2014
you can do this
A(B)=[];
This will delete the rows from A given the numbers that are stored in B.
0 commentaires
Plus de réponses (1)
Ondrej Budac
le 7 Avr 2014
If your matrix B has the row indices, it suffices to write
A(B) = [];
0 commentaires
Voir également
Catégories
En savoir plus sur Elementary Math 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!