To Find one element in a matrix or a Vector

3 ビュー (過去 30 日間)
Pardomuan Sitompul
Pardomuan Sitompul 2018 年 3 月 21 日
編集済み: Jan 2018 年 3 月 21 日
How can I know whether 0 is an element of a Vector or a Matrix
Thank you

採用された回答

Jan
Jan 2018 年 3 月 21 日
編集済み: Jan 2018 年 3 月 21 日
containsZero = ~all(V(:))
This avoids to create the temporary array V(:)==0 and for large arrays this should be a measurable advantage.

その他の回答 (1 件)

Stephen23
Stephen23 2018 年 3 月 21 日

カテゴリ

Help Center および File ExchangeLanguage Fundamentals についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by