フィルターのクリア

I have a number in one matrix, how do I find this number in a corresponding matrix?

1 回表示 (過去 30 日間)
I have a number in a matrix say 17 and I need to find this row number(17) in another matrix and find the corresponding value in that cell.
How do I pull the corresponding value for the row from another matrix?

採用された回答

Star Strider
Star Strider 2014 年 5 月 14 日
See if this does what you want:
A = [1:20]';
M = [10:27]';
y = M(A(17),:)
Here, A has numbers from 1 to 20, and we’re (not coincidentally) accessing A(17). The 17th row of M contains 26, and it returns that value in y. (If M had more than one element in row 17, the entire row would appear in y.)
  2 件のコメント
Franchesca
Franchesca 2014 年 5 月 14 日
This is what I want thank you very much!!
Star Strider
Star Strider 2014 年 5 月 14 日
My pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOperators and Elementary Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by