From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Equal?

Solved!
Go to solution

Hi, i have two 1d arrays with 7 elements inputting into a equal? comparison. My question is when the equal compares the two 1d arrays does it compare the entire are array of elements to the other array of elements. Or does compare one element from one array to the other element in that array untill its gone through all the elements.

 

Stu

0 Kudos
Message 1 of 6
(3,050 Views)
Solution
Accepted by topic author stu22

During comparison, it will check the corresponding index values only. So a(0) is compared to b(0) and a(1) to b(1). See the attached sample.

 

 

Message Edited by Mathan on 03-11-2010 06:21 AM
0 Kudos
Message 2 of 6
(3,046 Views)

Please keep in mind that comparing floating point numbers to "equal" is a bad idea. So do not compare to arrays with floating point numbers with the equal function.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 6
(3,033 Views)

Mathan wrote:

During comparison, it will check the corresponding index values only. So a(0) is compared to b(0) and a(1) to b(1). See the attached sample.

 


There is more to it than that.

 

If you right click on the = comparison, there is a a menu choice for Comparison Mode.  By default, it is Compare Elements and will return an array of booleans comparing element to element.

 

If you choose Compare Aggregates, then you will get a single boolean that is a comparison of the complete array to the other array.

 

So you can get both choices.  All you have to do is set the comparison mode the way you want.

Message 4 of 6
(3,012 Views)

Dear Stu,

 

You can better mark Ravens Fan post as solution since it is having very much information than mine.

 

Thanks,

Mathan

0 Kudos
Message 5 of 6
(2,972 Views)

hi,

 

Not sure if this is worth mentioning... when working with two arrays, the arithmetic takes effects up to the shorter one (in size)... 

 

Correct me if above is not correct. Thanks! 

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
Message 6 of 6
(2,957 Views)