Delete Rows with a specific condition

I have a matrix and I want to delete all rows that have ZEROS from columns 3 to end. How do?

 採用された回答

dpb
dpb 2013 年 10 月 2 日
編集済み: dpb 2013 年 10 月 2 日

1 投票

x(~any(x(:,3:end),2),:)=[];

その他の回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2013 年 10 月 2 日
編集済み: Andrei Bobrov 2013 年 10 月 2 日

1 投票

out = x(all(x(:,3:end),2),:);

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2013 年 10 月 2 日

編集済み:

2013 年 10 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by