How do I delete multiple elements from a column array using a while loop?
Mostra commenti meno recenti
For example if I wanted to delete every element in an array where the array is equal to 0?
Risposte (1)
Shubham Gupta
il 7 Nov 2019
Modificato: Shubham Gupta
il 7 Nov 2019
This should do the job:
A = [1 0 1 0 1 0 1 0]';
A(A==0) = []
1 Commento
Jan
il 7 Nov 2019
Or:
A = A(A ~= 0)
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!