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
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) = []

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

質問済み:

2019 年 11 月 7 日

コメント済み:

Jan
2019 年 11 月 7 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by