LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to compare rows in 2D array?

Solved!
Go to solution

Hi,

I have a 2D array of binary.

- I want to compare all rows against each other.

- Two rows should be compared if they have only one different element.

- The result of comparison should be a row with the different element assigned as 2 (or any number different from 0, 1).

- Continue to compare the result rows against each other.

- Repeat it until no row can be compare (those final rows should be presented).

 

Any idea will be appreciated!

0 Kudos
Message 1 of 12
(4,772 Views)

sangquang wrote:

I have a 2D array of binary.


"Binary" is not a type. deep down, everything is binary one way or another. What do you actually have?

 


sangquang wrote:

- Two rows should be compared if they have only one different element.


You have your oder of operations mixed up! You need to compare them first before you know if they have different elements.


sangquang wrote:

- The result of comparison should be a row with the different element assigned as 2 (or any number different from 0, 1).


Please explain


sangquang wrote:

- Repeat it until no row can be compare (those final rows should be presented).


Presented how? To the user? Does that mean all the result of the earlier row comparisons should not be presented? Why not?

 

You post makes very little sense. Please attach a simple VI that contains a simple example of your 2D array (make current value default before saving). Then tell us what kind of result you would expect.

0 Kudos
Message 2 of 12
(4,753 Views)

Hi altenbach,

I'm trying to programming Quine McCluskey method (minimizing logic functions having many variables).

You might want to take a look at this: http://en.wikipedia.org/wiki/Quine%E2%80%93McCluskey_algorithm

The attached file is what I have done so far.

I haven't found a good way for days. You could be my last hope. Thanks.

0 Kudos
Message 3 of 12
(4,748 Views)

Your controls don't contain any default data.

0 Kudos
Message 4 of 12
(4,746 Views)

I think I don't know how to keep current value default.

You can input numbers into the string (separated by space), for examle: 0 1 3 4 5 8.

 

0 Kudos
Message 5 of 12
(4,744 Views)

Right-click...advanced...make current value default. Save the VI.

 

Your code is exceedingly complicated. Here's code that basically does the same. I have a look at the algortithm later (probably not today).

Message 6 of 12
(4,740 Views)

Thanks. I'm looking forward to your answer.

0 Kudos
Message 7 of 12
(4,736 Views)

@altenbach wrote:

Right-click...advanced...make current value default. Save the VI.

 

Your code is exceedingly complicated. Here's code that basically does the same. I have a look at the algortithm later (probably not today).


In 2009 or atleast 2011 version code please.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 8 of 12
(4,725 Views)

@sangquang wrote:

Thanks. I'm looking forward to your answer.


No, you should try to solve it yourself. 😄

Message 9 of 12
(4,701 Views)

hi Altenbach,

It's my pleasure that you can point out a way for me.

This is where I get stuck.

Download All
0 Kudos
Message 10 of 12
(4,681 Views)