How to find out certain number in MxN matrix?

1 回表示 (過去 30 日間)
sam moor
sam moor 2017 年 4 月 23 日
編集済み: dpb 2017 年 4 月 24 日
I have a matrix as shown below in the figure. I want to find out the number greater than 0.7 going from left column to right except 1st row. For example, the number greater than 0.7 going from 1st column(except 1st row) is column 3. Than once, I found in column 3, I want to take minimum value of two rows (row 2 and row 3) (i.e. 0.7054). Than, I want corresponding number from 1st row of same column i.e. 0.45 from the figure below. Finally, I want to save in new matrix for this two number(0.45 and 0.7054).

採用された回答

dpb
dpb 2017 年 4 月 24 日
編集済み: dpb 2017 年 4 月 24 日
[i,j]=find(X(2:end,:)>0.7,1);
res=[min(X(2:3,j)); X(1,j)];
Do whatever you wish with the result.
  4 件のコメント
sam moor
sam moor 2017 年 4 月 24 日
thank you.
dpb
dpb 2017 年 4 月 24 日
Thx, Stephen for fixing typo...woulda' thunk ML would've prompted sam for automagic fixup...but I guess it wasn't parse-able enough for a guess, even.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by