how to take a value from multiple arrays defined from an expression.

1 回表示 (過去 30 日間)
simone zappalà
simone zappalà 2022 年 5 月 27 日
編集済み: Torsten 2022 年 5 月 27 日
I've 7 arrays(may call them A,B,C to G), each one contain 130 rows and 1 column with different numbers, these numbers are divided with others 7 arrays (may call them H to N)
for example
A./H B./I and so on...
So at the end I've 7 arrays that are created like I said before, then i found the max value from these 7 arrays (for each row i found the max value between 7 arrays with a for cycle). Now i've one last array, still 130 rows and 1 column, my question is how i understand for each max value i found what is the respective value that is originated (a number inside the matrix that goes from A to B)
for example
X=A./H
Y=B./I
max_value is a (130;1)
A(1;1) "is the numerator of the division that create the specific number" max_value(1;1)
B(2;1) "is the numerator of the division that create the specific number" max_value(2;1)
A(3;1) "is the numerator of the division that create the specific number" max_value(3;1)
i need all numbers (idx and/or value) from A to G that create the final array max_value.

回答 (1 件)

Torsten
Torsten 2022 年 5 月 27 日
編集済み: Torsten 2022 年 5 月 27 日
for each row i found the max value between 7 arrays with a for cycle
If you found the max value, you also found whether A/H,B/I,C/J,...,G/N produced it.
Only save in this position of your code max_value(i) = A(i),B(i),...,G(i) depending on which array produced it.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by