How do I delete multiple elements from a column array using a while loop?
Afficher commentaires plus anciens
For example if I wanted to delete every element in an array where the array is equal to 0?
Réponses (1)
Shubham Gupta
le 7 Nov 2019
Modifié(e) : Shubham Gupta
le 7 Nov 2019
This should do the job:
A = [1 0 1 0 1 0 1 0]';
A(A==0) = []
1 commentaire
Jan
le 7 Nov 2019
Or:
A = A(A ~= 0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!