Reputation: 437
I will be performing scans in an unknown number of dimensions. For example, I want to loop over two angles and two voltages, so 4D one time, and the next time maybe it's 3D or 6D. I make an array of clusters of [parameter, start, stop, delta] that will in these cases have 4, 3, or 6 elements in the array.
How can I index that array and in some way make either 4, 3, or 6 nested for loops using the information?
Upvotes: 1
Views: 353
Reputation: 437
I figured out this can be done fairly simply with a recursive vi. The vi pulls out the 0 index of the array and loops over the min/max/delta of elem 0. Within the loop, if there are more elements in the initial array then it recursively calls itself with the new array (after 0 pulled out). If there are no more elements in the array then it takes a measurement.
Upvotes: 1