Removing rows of a matrix based on certain criteria

3 ビュー (過去 30 日間)
Poulomi
Poulomi 2014 年 12 月 11 日
回答済み: Matt J 2014 年 12 月 11 日
I have a matrix
A = [110 1 2 3 4;
111 11 12 15 16; 112 0 0 0 0;
113 9.43e+36 9.43e+36 9.43e+36 9.43e+36;
114 34 45 67 89].
I want to delete those rows, which contains elements 0 and 9.43e+36 from 2nd to end column of matrix A so that my resulting matrix should be
A = [110 1 2 3 4;
111 11 12 15 16;
114 34 45 67 89].

採用された回答

Matt J
Matt J 2014 年 12 月 11 日
idx=any(~A(:,2:end) | A(:,2:end)==9.43e+36,2);
A=A(~idx,:)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by