I have m*n matrix. I want keep only those rows whose atleast one element is greater than any specific value such as 1.

2 views (last 30 days)
I have m*n matrix. I want keep only those rows whose atleast one element is greater than any specific value such as 1.

Accepted Answer

Mathieu NOE
Mathieu NOE on 14 Oct 2021
hello
try this
m = 3;
n = 5;
A= 1.15*rand(m,n);
threshold = 1;
a = A>threshold;
rows = find(any(a, 2));

More Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by