LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

deleting elements of one array by comparing it to the elements of another array

I m a newbie to LabVIEW and I have a very basic question.
 
I have two arrays. The first array contains a certain set of elements
 
For e.g.  1 2 3 4 5 6
 
The second array has another set of elements
 
For eg. 2 5 6
 
Now I want to delete the elements 2 5 6 from the first array and plot the first array with the deleted elements on a waveform graph.
 
Can anybody help me out?
 
Thanks and regards.
0 Kudos
Message 1 of 6
(3,357 Views)
Hello,
you could do something like this:



Greets, Dave

Message Edited by daveTW on 02-23-2007 05:07 PM

Greets, Dave
Download All
0 Kudos
Message 2 of 6
(3,349 Views)
Prakruthi,

attached you can find a picture of a working solution, but it is definetly NOT the best one.

Disadvantages:
- Direct comparison with "=" should only be done with integers. Floating point number have some major issues here since 2.00 != 2.00 (not always, but more often than suspected!).
- Due to the two nested loops there could be some overhead which can be prevented with other approaches...

nevertheless, i hope this helps 🙂

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

your solution looks nicer than mine, i have to admit. BUT: what if you have e.g. "5" in your array twice or more times??

Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 6
(3,340 Views)
Hi Norbert, you are right, this is not worth a star Smiley Sad
But I put in another while loop and it should work...



Greets, Dave

Message Edited by daveTW on 02-23-2007 05:26 PM

Greets, Dave
0 Kudos
Message 5 of 6
(3,336 Views)

Hi Dave,

 

Thank you for the quick reply. That is exactly what I tried to do. But Im doing something else wrong. My final waveform, still appears with the undeleted elements.

I have attached the vi for a better understanding.

Thanks and regards,

Prakruthi

0 Kudos
Message 6 of 6
(3,333 Views)