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

1 Ansicht (letzte 30 Tage)
simone zappalà
simone zappalà am 27 Mai 2022
Bearbeitet: Torsten am 27 Mai 2022
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.

Antworten (1)

Torsten
Torsten am 27 Mai 2022
Bearbeitet: Torsten am 27 Mai 2022
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.

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by