필터 지우기
필터 지우기

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

조회 수: 2 (최근 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 CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by