How do we find value greater than certain number in a array?

13 ビュー (過去 30 日間)
sam moor
sam moor 2017 年 4 月 23 日
コメント済み: sam moor 2017 年 4 月 24 日
I have 2 dimensional array as shown in the figure below. I want to search the number from left to right that is greater than 0.1 in both rows. for example, the condition that satisfies greater than 0.1 from left(begin from left) is column 2 and pick the smaller number of two rows of column 2 i.e. 0.6071 and store the number in new matrix. Any idea is appreciated.

採用された回答

the cyclist
the cyclist 2017 年 4 月 24 日
new = min(a(:,find((all(a>0.1)),1)));
  1 件のコメント
sam moor
sam moor 2017 年 4 月 24 日
Hi Cyclist, Is there any way to do same in below figure matrix. I want to find out the number that passes 0.7 from left column to right column except for 1st row. Once I found out value passing 0.7 (i.e. in column 3) I take minimum of row 2nd and 3rd (0.7054) and than save the minimum value and corresponding 1st row value of that column (i.e.0.45). Your idea is much appreciated. Thank you.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by