How do I delete multiple elements from a column array using a while loop?
1 view (last 30 days)
Show older comments
For example if I wanted to delete every element in an array where the array is equal to 0?
0 Comments
Answers (1)
Shubham Gupta
on 7 Nov 2019
Edited: Shubham Gupta
on 7 Nov 2019
This should do the job:
A = [1 0 1 0 1 0 1 0]';
A(A==0) = []
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!