LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement index array inside case structure for searching a 3D array?

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?

0 Kudos
Message 1 of 7
(4,147 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(4,142 Views)

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.?

0 Kudos
Message 3 of 7
(4,136 Views)

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.

0 Kudos
Message 4 of 7
(4,131 Views)

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.

0 Kudos
Message 5 of 7
(4,114 Views)

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

0 Kudos
Message 6 of 7
(4,109 Views)

Here's how you search in a 3D array.

3D Search.png

Message 7 of 7
(4,092 Views)