LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

search 2D array indexes

Just a simple question... I'm new with Labview...I need to search indexes of 2D array element that contain the number of 1. I tried to do it but it only worked for the first 1D array because my initial value of feedback don't reset to zero after the first loop. How can I improve this?
0 Kudos
Message 1 of 3
(8,409 Views)

Since each index contains two coordinates, your output needs to be a 2D array. There are many ways to do this, here's a simple version.

 

(Of course it is very dangerous to use this on floating point values (e.g. DBL), unless you can guarantee that you are dealing with exact value)

 

Message Edited by altenbach on 12-20-2008 10:30 AM
Download All
Message 2 of 3
(8,387 Views)

You could also reshape your array to 1D, search the 1D array, and then calculate the 2D indices. It's probably not worth the extra code. 😉

 

Message Edited by altenbach on 12-20-2008 10:45 AM
Download All
Message 3 of 3
(8,383 Views)