01-08-2012 01:32 AM
hi all
i have a 10X10 2d array of reasult. for instance:
1 2 3 4
5 6 7 8
9 10 11 12
and i want a specific values from the array/ say 1,3,7 and 10 (there is no given pattern to work with..)
I used the IndexArray but because it's about 20 values, it's hell to change and hell to debug...
Is there any more elegant way to do this?
thanx!
(this is one great forum, it's my first time posting a question but i've been following you for a while!)
Solved! Go to Solution.
01-08-2012 08:53 AM - edited 01-08-2012 08:55 AM
Assuming you know the values you are looking for, index the 2d array using a for loop and search for the specific value/s using search 1D array node.
I've to add that your question is a bit vague and may be barking up the wrong tree! It would help a great deal if you posted a snippet/vi of your current implementation.
01-08-2012 10:45 AM
thanx for replying!
i currently have problem with the network on my labview computer so i cant upload pics or so..
i'll further explain:
the 2d array is a result of set of tests from which i want to take the results that are important for me.
i dont know the values for each test but the locations are constant.
the problem is that the IndexArray is too hard to read or change because of the quantity of the tests
thanx!
01-08-2012 12:29 PM
OK, so if I understand this currectly, you have a 2D array with 100 elements and you want to pick out 20 values whose index locations are constant.
"take the result" is a poorly defined description. What are the exact indices you want? Is there a regular pattern?
How do you want the output?
@sebastiant wrote:
the problem is that the IndexArray is too hard to read or change because of the quantity of the tests
I don't understand. What are you "reading"? What is a "test"? Why is it "hard"?
01-09-2012 12:24 PM
You can drag the index array function down, creating something that looks like this:
That will allow you to output multiple elements from the same array simultaneously, by putting in each separate set of indices. If you want to make it easier to debug, make the indices inputs, name them effectively, and group them in x,y pairs.
You could also make a boolean array and use that to select the indices you want. This makes more sense if your indices need to be selected graphically.
01-10-2012 02:16 AM
wow!
colden R im in debt for you for all eternity!!
the second solution is great and exactly what i needed!
thank you very much!