Extracting data from a matrix

1 次查看(过去 30 天)
I have a 50x3 matrix with numerical values. I want to take all the rows that have 2 zeros or more out For example
0 25 15;
0 0 25;
16 13 12
I only want to get out the first and the third row. And I do not wish to do that manually with 50 rows.

采纳的回答

Andrei Bobrov
Andrei Bobrov 2017-4-30
a = [0 25 15;
0 0 25;
16 13 12];
out = a(sum(a == 0,2) < 2,:)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by