How do I delete multiple elements from a column array using a while loop?
古いコメントを表示
For example if I wanted to delete every element in an array where the array is equal to 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) = []
1 件のコメント
Jan
2019 年 11 月 7 日
Or:
A = A(A ~= 0)
カテゴリ
ヘルプ センター および 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!