LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I easily step through Matrix Combinations in Labview 7.1?

I have a 2D matrix of test parameters that I'd like to step through, hitting all possible combinations. I'd like the system to be dynamic so that I can input a matrix of any size.

The obvious solution is to use nested for loops, but I don't think that will allow me to handle dynamic matrix sizing. Any help would be appreciated! Thanks!

Neville
0 Kudos
Message 1 of 7
(3,574 Views)
What do you mean by "hitting all possible combinations"? (e.g. All possible combinations of selecting k elements?).
Could you clarify your question? Thanks!
0 Kudos
Message 2 of 7
(3,574 Views)
I mean that if you have a 3x3 matrix, you have 27 combinations and if you have a 3x4 matrix, you have 81 combinations. If I have an mxn matrix, I will have m^n combinations.
0 Kudos
Message 3 of 7
(3,574 Views)
(Maybe this is obvious to everyboy except me, but ...)

Sorry for sounding a bit slow, but could you give a few examples for what you consider a "combination" from e.g. a 3x3 array?
0 Kudos
Message 4 of 7
(3,574 Views)
I agree. I cannot find a combination or permuation way to manipulate the matrix to get the expected outcomes. An example will be exreemly helpful.
0 Kudos
Message 5 of 7
(3,574 Views)
Sure. If I have a 3x3 matrix with the numbers 1,2,3 on the first row, 4,5,6 on the second, and 7,8,9 on the third, I want to generate the following matrix:
1,4,7;1,4,8;1,4,9;1,5,7;1,5,8;1,5,9;1,6,7;1,6,8;1,6,9;2,4,7;2,4,8;2,4,9;2,5,7;2,5,8;2,5,9;etc. I think you get the idea. : ) The trick here is this procedure has to be expandable to a matrix of any size. Thanks!
0 Kudos
Message 6 of 7
(3,574 Views)
I have been on vacation. Here is a custom Braden algorithm. Enjoy!!
Message 7 of 7
(3,574 Views)