How do I delete multiple elements from a column array using a while loop?
1 次查看(过去 30 天)
显示 更早的评论
For example if I wanted to delete every element in an array where the array is equal to 0?
0 个评论
回答(1 个)
Shubham Gupta
2019-11-7
编辑:Shubham Gupta
2019-11-7
This should do the job:
A = [1 0 1 0 1 0 1 0]';
A(A==0) = []
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!