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

1 visualización (últimos 30 días)
simone zappalà
simone zappalà el 27 de Mayo de 2022
Editada: Torsten el 27 de Mayo de 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.

Respuestas (1)

Torsten
Torsten el 27 de Mayo de 2022
Editada: Torsten el 27 de Mayo de 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.

Categorías

Más información sobre Structures en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by