how to determine row with all zero

For example ; adj=[ 0 0 14 15; 0 0 0 0; 4 0 0 14; 3 10 0 14; 0 3 0 0; 9 10 12 15; 8 9 10 15; 7 9 0 12; 6 7 8 15; 4 0 6 7; 0 0 0 8; 6 8 0 14; 0 3 0 12; 0 3 4 12; 0 6 7 9;] How to determine row if all elements of that row zero For example, row 2 How to determine row which all element zero

回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2017 年 4 月 5 日

5 投票

row_all_zeros = find(all(adj == 0,2));

1 件のコメント

NALLARASU KRISH
NALLARASU KRISH 2023 年 2 月 24 日
This command works pleasantly. Keep doing good!

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeData Type Identification についてさらに検索

タグ

質問済み:

2017 年 4 月 5 日

コメント済み:

2023 年 2 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by