‎06-16-2015 01:15 PM
Well I have a 3D array and I want to index certain elements from that array. And I have thought of one way of doing this is to have multiple index array functions on the block diagram to search the array simultaneously, but that would be messy. Or I could setup some kind of case structure and place each index array function into individual cases. I've tried the latter, but when I connect the 3D array to the case structure at the"?" it doesn't give me permission because it says I'm hooking up two different types of data. Case Structure is for T or F and 3D array is not a boolean.
So how can I setup the Case Structure to work for a 3D array?
‎06-16-2015 01:20 PM
A case structure's selection tunnel cannot accept an array. What exactly are your search criteria? It sounds like a few FOR loops will be needed.
‎06-16-2015 01:25 PM
Okay, it won't work. That's what I was thinking. Ah, I just need a bunch of index array functions to scan a 3D array and output some elements from it. I thought to put it in a case structure just as a means of cleanliness. Less confusing on screen and such. As for the For Loop, are you talking about putting a For Loop inside a For Loop and etc.?
‎06-16-2015 01:27 PM
The For Loop would work for a single index array function that For Looped through a bunch of arrays or something, but I need each individual index array to search for a specific and different element each time if that makes more sense.
‎06-16-2015 01:48 PM
Three nested For Loops would iterate through each dimension.
If the search item needs to be different for each column for instance, then you could have a 1-D array that also auto-indexes on whichever level of the loop is auto-indexing through the columns.
‎06-16-2015 01:51 PM
Consider a combination of one or more For loops and Threshold 1D Array or Search 1D Array for the searches. Read the detailed help files on Threshold... and Search.. to understand the differences and to determine which might be useful in your situation.
Lynn
‎06-16-2015 03:44 PM - edited ‎06-16-2015 03:49 PM
Here's how you search in a 3D array.