キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Need help with 2D array

解決済み
解決策を見る

aveo wrote:

If you will take a look at the array the 6th row(starting from 0) has 10 and is not a subset of any other row.

However in Find_Overlapping_Rows_MODCA.vi it is not coming as i want it.


OK, it is a complete mystery where else you exepct the "10" to appear in the output array. Here's what I get with my code.

 

 

 

We cannot solve a problem unless it is fully defined. Currently it is not!

 

 

0 件の賞賛
メッセージ11/16
1,377件の閲覧回数

The 10 should appear in a new row (and not with 8,9). This is because, if you take a look at the input array, 

10 is not present in the row where 8,9 is.

You can see the required output if you run my code( Find_Overlapping_Rows.vi) with the same array.

Guess my problem can be solved if i use my vi only.... but sadly it is complicated. i thought i would be able to

make something more simple 😞  

My apologies that i am still unable to clearly explain the problem statement to you.

let me breakdown the problem with this example.

consider the input array  1  2  3  4  5  6  7

                                    2  3  6  0  0  0  0

                                    3  2  7  0  0  0  0

                                    4  5  0  0  0  0  0

                                    7  1  0  0  0  0  0

                                    8  9  0  0  0  0  0

                                   10 0  0  0  0  0  0

the 2,3,6  in 2nd row is already found in 1st row so delete 2nd row.

the 3,2,7  in 3rd row is already found in 1st row so delete 3rd row.

the 4,5  in 4th row is already found in 1st row so delete 4th row.

the 7,1  in 5th row is already found in 1st row so delete 5th row.

the 8,9  in 6th row is not found in any other rows so retain it.

the 10  in 7th row is not found in any other rows so retain it.

 thus the output array must have. 

 1  2  3  4  5  6  7

 8  9  0  0  0  0  0

10 0  0  0  0  0  0

Hope i have cleared it a little bit now. 

Thanks for all the help and quick reply 🙂  

 

Regards

Aveo

 

0 件の賞賛
メッセージ12/16
1,365件の閲覧回数

OK, now it is clearer. Unfortunately it is 1am here, so I will look tomorrow. I am sure this can still de done with much less code! 🙂

 

Are these alway small integers? What is the range of values that can occur overall. How long can the rows be?

0 件の賞賛
メッセージ13/16
1,362件の閲覧回数
解決策
受理者 aveo

OK, try this:

 

(assuming the integers are all <100, modify as needed.)

 

すべてをダウンロード
メッセージ14/16
1,355件の閲覧回数

Hi Altenbach, Yes this is what i was looking for! 🙂 The rows will be between 200 or 300 at most. 

This works amazingly without complicating the program. Thanks a mighty lot for this. 🙂 

Regards

Aveo

0 件の賞賛
メッセージ15/16
1,351件の閲覧回数

Yes, then you simply need to increase the lookup array size a little bit. Even if there is no known upper limit for the numbers, the code would not be much more complicated, but we would need to change the code a little bit.

 

SImple problems always have simple solutions! 😄 Note the use of the "-1". This is to automatically ignore all zeroes.

0 件の賞賛
メッセージ16/16
1,337件の閲覧回数