LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combiation of 4 goups of numbers and each group containing 2 numbers

I am stuck here with the problem. I want to make a VI which makes the combination of 4 groups of number and each group containing 2 numbers.  This should result in 16 combination. This is simillar to the classical problem of P&C where  we have 4 urns and each urn contains 2 different ball.

 

Thank you in advance,

 

0 Kudos
Message 1 of 15
(3,032 Views)

4 arrays with 2 elements in each array? Or a single 2 dimensional array: 4x2 elements?

Where did you get 16 values from? 

_____________________________
- Cheers, Ed
0 Kudos
Message 2 of 15
(3,020 Views)
Yes. 4 arrays with 2 elements in each array.
0 Kudos
Message 3 of 15
(3,012 Views)

Hi interstellar,

 

your question is solved by using some basic features of LabVIEW: autoindexing and shift registers!

check.png

 

Please do the basic tutorials!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(3,007 Views)

deleted

 

 

0 Kudos
Message 5 of 15
(3,004 Views)

Thanks a lot GerdW. Kudos indeed. 🙂

I made the VI. Actually I am not very comfortable with autoindexing and shift registers. So it would be of great help to me if you can explain me how to make 16 element array. Each element of the array say represent the sum/product of combination.

0 Kudos
Message 6 of 15
(2,988 Views)

Thanks a lot GerdW. Kudos indeed. 🙂

I made the VI. Actually I am not very comfortable with autoindexing and shift registers. So it would be of great help to me if you can explain me how to make 16 element array. Each element of the array say represent the sum/product of combination.

Thanks for your help.

0 Kudos
Message 7 of 15
(2,987 Views)

Another good old-fashioned Cartesian product.  See here:

 

http://forums.ni.com/t5/LabVIEW/3-loops-incrementing/m-p/1439422#M552998

0 Kudos
Message 8 of 15
(2,974 Views)

Is there a 64 bit version of the cartesian product vi? I'm trying to setup a routine for image filtering. I have 9 types of filters that can vary the filter level from 0-9 for each typeof filter. I'm trying to get the list of indices for all combinations. I'm thinking that the cartesian product vi is hanging up with the large number of permutations. Basically I have 90 choices for each of 9 layers of filtering.

0 Kudos
Message 9 of 15
(2,931 Views)

I'd use the lower snippet in that post to get the individual values instead of the entire list at once.

 

0 Kudos
Message 10 of 15
(2,926 Views)