12-16-2009 03:47 AM - edited 12-16-2009 03:49 AM
Hi,
I have 2D array which contains Power Supply setup list defined by user. The number of PSs (array rows) is not fixed. For example - 3 PSs:
Name Min Max Step
PS1 3.0 3.6 0.3
PS2 0.9 1.2 0.1
PS3 1.7 1.9 0.1
I need to build from this list an array of all combinations as below:
PS1 PS2 PS3
3.0 0.9 1.7
3.0 0.9 1.8
3.0 0.9 1.9
3.0 1.0 1.7
3.0 1.0 1.8
3.0 1.0 1.9
3.0 1.1 1.7
3.0 1.1 1.8
3.0 1.1 1.9
3.0 1.2 1.7
3.0 1.2 1.8
3.0 1.2 1.9
3.3 0.9 1.7
3.3 0.9 1.8
3.3 0.9 1.9
3.3 1.0 1.7
3.3 1.0 1.8
3.3 1.0 1.9
3.3 1.1 1.7
3.3 1.1 1.8
3.3 1.1 1.9
3.3 1.2 1.7
3.3 1.2 1.8
3.3 1.2 1.9
3.6 0.9 1.7
3.6 0.9 1.8
3.6 0.9 1.9
3.6 1.0 1.7
3.6 1.0 1.8
3.6 1.0 1.9
3.6 1.1 1.7
3.6 1.1 1.8
3.6 1.1 1.9
3.6 1.2 1.7
3.6 1.2 1.8
3.6 1.2 1.9
How to build this array programmatically?
(Notice again that number of rows in the source array is not fixed.)
Thanks in advance!
Solved! Go to Solution.
12-16-2009 03:57 AM
Hi Berezka,
first you have to create arrays (aka "vectors") for each PS ([3.0,3.3,3.6]; [0.9,1.0,1.1,1.2];...).
In the 2nd step you have to take the first two "vectors" to combine to a 2D array for each combination.
In the 3rd step you take the 2D array and the next "vector" to add a column in the 2D array to create again all possible combinations.
4th step: repeat 3rd step for each other "vector"
12-16-2009 04:09 AM
Thanks for a quick answer.
"In the 2nd step you have to take the first two "vectors" to combine to a 2D array for each combination."
How to do this?
12-16-2009 04:15 AM - edited 12-16-2009 04:16 AM
12-16-2009 05:37 AM