LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mismatch array elements

Solved!
Go to solution

Hi,
I'm comparing the two input arrays, I'm in need to determine the mismatch elements between two arrays.
I've attached the image for the reference.

0 Kudos
Message 1 of 6
(1,402 Views)

Hi Padmanaban,

 

some pseudocode:

a[] := AppendArrays( input1, input2)
FOREACH element in a[]
  bool1 := element found in input1?
  bool2 := element found in input2?
  IF bool1 NAND bool2 THEN
    append element to output[]
  ENDIF
NEXT

What have you tried so far?

Where are you stuck?

You know we will not do your homework!?

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
0 Kudos
Message 2 of 6
(1,395 Views)

Hi,

I got struck at Array indexing while using with nested for loop.
If 1st input array index was enabled in outer loop, then I can find only the missing element from 1st array and Vice versa.
So I've to find missing elements from both input array inputs.

0 Kudos
Message 3 of 6
(1,384 Views)

Hi Padmanaban,

 

did you understand my pseudocode?

Your VI uses a different approach than my suggestion - maybe that's the problem? 😄

 

Attaching just images of code doesn't help a lot. We cannot debug/test your image with LabVIEW.

Please attach your VI!

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
0 Kudos
Message 4 of 6
(1,357 Views)

I've attached the snippet.
Can I do this both mismatch elements functionality within single nested forloop?

 

0 Kudos
Message 5 of 6
(1,353 Views)
Solution
Accepted by topic author PadmanabanJ

Hi Padmananbad,

 

sure you can do it with just one loop!

As I described by the pseudocode above:

check.png

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
Message 6 of 6
(1,345 Views)