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

3 ビュー (過去 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 Center および File ExchangeData Types についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by