LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

compare arrays

Hello all, I am new to labview and i am trying to compare two arrays to see if they are equal. What i am trying to do is read cell values from excel and move them into an array. Then i would like to compare that array with a constant array in my labview program. Any help is greatly appreciated.
0 Kudos
Message 1 of 5
(17,725 Views)
Just use the equal function under the comparison menu of the functions pallette.
Message 2 of 5
(17,725 Views)
It really is that simple and John's answer doesn't deserve one star. There are two comparison modes. One is compare aggregates. This returns a Boolean if all elements in both arrays are equal. The other mode is compare elements. This returns an array of Booleans so you determine which elements are equal or not. This is all explained in the on-line help. Open the context help window to get to this info.
Message 3 of 5
(17,725 Views)

Do attention with the "aggregates" function.

 

Comparing two arrays, for example 3,2,1,0 and 3,2,1 gives "different"

When comparing if all values in an array are zero, the dimension must also be right !

 

So before comparing the values, I compare the length, causing an error if unequeal.

 

In my case, compare if everything is zero, I use the "Array max&min" function. (Max<>0 and Min <>0)

 

.

 

Message Edited by ST5 on 08-11-2009 05:00 AM
Message 4 of 5
(16,999 Views)

It amazes me that wisdom can be passed down through this forum and still be useful 18 years later, it's a privilege to have access to this fountain of knowledge.

 

Thank you for your help oh-wise-man

0 Kudos
Message 5 of 5
(2,555 Views)