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

조회 수: 1 (최근 30일)
I have m*n matrix. I want keep only those rows whose atleast one element is greater than any specific value such as 1.

채택된 답변

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by