If I have a matrix like this one:
45 23 54
0 0 0
9 3 32
How can I remove the second row and obtain this matrix?
45 23 54
9 3 32

 採用された回答

David Fletcher
David Fletcher 2018 年 3 月 8 日
編集済み: David Fletcher 2018 年 3 月 8 日

1 投票

a=[45 23 54;0 0 0;9 3 32];
zero=a==0;
ind=all(zero,2);
a(ind,:)=[]
Presumably the entire row has to have zero in every column for it to be removed

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLinear Algebra についてさらに検索

質問済み:

2018 年 3 月 8 日

編集済み:

2018 年 3 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by