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

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Structures 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by