I have a data AB=[1 2
3 4
5 6
0 7
8 0
0 0
9 0
0 10
0 0]
I want to delete [0 0], so the result will be
[1 2
3 4
5 6
0 7
8 0
9 0
0 10]

 採用された回答

Jonas
Jonas 2022 年 6 月 30 日
編集済み: Jonas 2022 年 6 月 30 日

0 投票

use
rowsToDelete=~any(AB,2);
or
rowsToDelete=all(~AB,2);
AB(rowsToDelete,:)=[];
or
rowsToKeep=any(AB,2);
AB=AB(rowsToKeep,:);

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で MATLAB についてさらに検索

製品

タグ

質問済み:

2022 年 6 月 30 日

編集済み:

2022 年 6 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by