Removing rows of a matrix based on certain criteria

3 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by