취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

max and min of 2d array

해결 완료!
솔루션으로 이동

Hello,

can someone show me how to do a max and min of an 2d array

 

Untitled.png

 

i am oonly looking at colum 0,1,2

 

the max of 0,1,2

the min of 0,1,2

 

in my example, it would be 13.612 is max and min is 10.059

i am thinking i have to do two for loop but i havent figured out how. 

thanks in advance. 

0 포인트
1/8 메시지
6,589 조회수

A single loop containing the Max/Min function would suffice.  Auto-indexing the 2-d array will give you rows and you are interested in columns.  So either transpose the array or use the Array Index function to get columns.  Wire the 1D array to Max/Min function, connecting the outputs to a shift register.  For each additional column, compare the new max/min values with those from the previous iteration and pass the correct value into the shift register.  Essentially comparing the max/min for each column to eachother in order to get the max/min for the whole array.  You can stop the loop early if you are only interested in a few columns.

0 포인트
2/8 메시지
6,583 조회수

The Array Max & Min function can take in a 2D array.  No loop required.

Nevermind.  Just looked over your example again.  You will want to use Array Subset in order to get your first three columns and then use Array Max & Min.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
3/8 메시지
6,576 조회수

The Array Max & Min function from the Array palette accept a 2D array input, just use it directly no need of any loop.

 

Ben64

4/8 메시지
6,573 조회수

yeah. it can

but i dont want to look at column 3,4,5

 

when i use it

i will see 13.612 as max

and 3.018 has min. which i am not interested in.

i am only looking between column 0,1,2

 

 

0 포인트
5/8 메시지
6,569 조회수
솔루션
승인자 super_saiyans

@super_saiyans wrote:

yeah. it can

but i dont want to look at column 3,4,5


Use Array Subset to remove them.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
6/8 메시지
6,565 조회수

i guess i can remove it, but i was hoping that there's another solution.

but okay. that will do for now. thanks!

 

0 포인트
7/8 메시지
6,562 조회수

You can keep your original data and only use the subset as an input to the max/min.  This only "removes" the extra data for your calculation while keeping the whole data set

8/8 메시지
6,506 조회수