05-25-2011 09:20 AM - edited 05-25-2011 09:22 AM
Hello, I need some urgent help if possible.
I'm fairly new to Labview but I do have a certain basics.
I'm trying to accomplish the following.
I have 2 arrays of the same size.
I'm comparing the elements of the first array to a certain value.
If some of the elements fits this requirement I want the compare the corresponding elements in the second array to another value.
If the elements of this second array are indeed greater then this new value I want to switch a boolean output to yes.
EXAMPLE!
Array1 =
1 2 6
5 4 9
3 7 2
Elements of Array1 > 5 ?
x x 6
x x 9
x 7 x
Array2 =
6 4 1
6 5 7
9 8 3
I only want to use the elements at the position corresponding to the elements from array1 that were greater then 5.
All other elements can be ignored.
New Array2 =
x x 1
x x 7
x 8 x
Elements of Array2 > 6 ?
x x x
x x 7
x 8 x
If Answer = 0 : Boolean = false
In this case : Answer = 2 elements : Boolean -> True
I could really use some help.
Any idea is welcome.
Thank you in advance.
Solved! Go to Solution.
05-25-2011 09:25 AM
I would make both array comparisons. You'd wind up with two arrays of boolean values. Then AND those arrays together. Now you have an array of booleans where a True means the element in the first array met condition 1 and the same element in the second array met condition 2.
05-25-2011 09:34 AM
Nice Idea !
I will test this.
But how to know the positions in the arrays of these elements now?
05-25-2011 09:40 AM
I am not sure I full understood but I threw this together really quick.
Seems to do what you wanted but it's ugly and I am sure there are better ways...
05-25-2011 09:44 AM - edited 05-25-2011 09:51 AM
There are many ways to do this.
05-25-2011 10:48 AM
@RTSLVU wrote:
I am not sure I full understood but I threw this together really quick.
Seems to do what you wanted but it's ugly and I am sure there are better ways...
I responded to your duplicate thread and assumed single dimension arrays, so ignore my response.
05-26-2011 07:43 AM
@ Ravens Fan : Thank You