I want to program a UI that can accept the number of dimensions as input and create an n-dimensional array as output. Anyone can help?
Sorry, I asked my question wrong.
The question should be:
If I have an n-dimensional array as input (the number of dimensions n is also an input), is there a way to traverse every element of the array?
Yes you can do that, but when the dimension "n" increase the number of index input required to access an element will also increase.
You can't dynamically set the number of dimensions in an array, if that is what you are asking. But you can initialize an array of any size. The Initialize Array can expand, so you can create an N dimensional array that way. LabVIEW has to know the data type, and the number of dimensions is part of the array data type.
You can internally initialize an array with the maximum number of dimensions, then only fill some of the dimensions. Keep track of the highest "used" dimension.
You can easily traverse all used elements. What have you tried?
(easiest would be to reshape to a 1D array, then autoindex at a FOR loop boundary).