LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

match 2d array

Hi everyone,

 

I have two 2-D array, one of them contains more data than the other. The attached file is the example file. I would like to get the matched data from both 2-D arrays and delete away the others. Is there any way to do that so?? Pls help me out.. thanks

0 Kudos
Message 1 of 5
(2,797 Views)

If I was doing this, I would just do a straight up loop through one array and compare to the other array.

 

So feed one array into a loop using auto-indexing.  This will look at the array 1 row at a time.  Loop through the other array 1 row at a time.  Compare the rows to each other.  If they match, build the data into a new array (stored in a shift register) stop the inner loop and move on to the next item of the first array.  If there are no matches, then just move on to the next item of the first array.

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

@Ryamnod wrote:

Is there any way to do that so??


LabVIEW is a full featured programming language, so doing simple things like this are easily possible.

 

The answer to your question is thus yes, there is a way!

 

How familiar are you with LabVIEW? What have you tried so far?

 

 

I assume that you want to match entire rows, so it is really a 1D problem. Are that arrays sorted by row? Do you need to preserve the order? Could you attach a small VI containing two typical datasets?

 

Is the smaller array a subset of the larger array or are there elements in either array that are not in the other?

 

0 Kudos
Message 3 of 5
(2,784 Views)

Hi Mr.Knight of NI,

 

I'm a 16-year old kid who's struggling with his labview programming parts. So if my questions are so simple and so childish, correct me if I'm wrong, ain't I deserve to be advised?? Please consider my problems and help me out. I disguise "Ni.com" as god of labview as it is the only way i can get my solutions through. My teachers won't teach me anything as this is a self-depend project. So thanks a lot for your help. And i'll be willingly to see your replies in future again.. Thanks

 

Raymond

0 Kudos
Message 4 of 5
(2,767 Views)

Ryamnod wrote:

I'm a 16-year old kid who's struggling with his labview programming parts. So if my questions are so simple and so childish, correct me if I'm wrong, ain't I deserve to be advised?? Please consider my problems and help me out. I disguise "Ni.com" as god of labview as it is the only way i can get my solutions through. My teachers won't teach me anything as this is a self-depend project. So thanks a lot for your help.


Its a weekend here, so we have other things to do. We cannot spend 24hours/day in the forum. 🙂

 

In order to make our job easier, you need to do your part. Did you read my entire post above?

 

Do you really expect me to start a new VI and type in all the fields from your images in order to program a simple solution? Since you already have that, attach your VI here so we have something to start with. Make sure the controls have data (as shown in your picture) and "make current values default" before saving.

 

We do not know the LabVIEW experience of people asking questions. Do you have problems programming LabVIEW in general or do you simply need help implementing a specific algorithm?

 

I also asked quite a few questions in my earlier post that you have not answered yet. These answers are important to decide on an algorithm.

 

Sometimes, I will provide solutions (or partial solutions), but that does not mean you are getting away scot-free. If you would turn in my solution, you better understand every single nuance of every single code detail and why it works. This is an opportunity to finally learn what you should have learned a few classes ago. Trust me, your teacher also reads these forum posts.

 

How to use a forum and ask good questions is a skill that you need to learned too. So please take this opportunity. 😄

 

 

 

 

Message 5 of 5
(2,760 Views)