[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Newbie - Common value patterns in many vectors
From: |
thombark |
Subject: |
Newbie - Common value patterns in many vectors |
Date: |
Wed, 5 Oct 2011 04:15:52 -0700 (PDT) |
I have a large number of vectors. Each contains from 1 to 100 numbers, and
each number is within the range 1-60. I need to find the vectors containing
N common numbers. For example, here are 6 vectors:-
1 12 28 46
12 16 46 49 52 58
8 12 24 28 33 45 46 47 53 57
9
12 16 24 28 46 52
18 33 45
If N is 3, then I am looking for any vectors containing at least 3 common
values.
In this case, vectors 1,3,5 have "12 28 46" in common and vectors 2,5 have
"12 16 46 52" in common.
The final result would be 2 vectors - (1,3,5) and (2,5).
I can have the vectors as an array but then I would need an array of
(thousands,100) where most of the array entries would be zero, since 90% of
the vectors/rows would have < 10 elements.
Even using the intersect function this still needs too much processing time.
I don't know the octave functions - is there a quicker solution?
Thanks.
The number "12" is in vectors 1,3,5.
--
View this message in context:
http://octave.1599824.n4.nabble.com/Newbie-Common-value-patterns-in-many-vectors-tp3874114p3874114.html
Sent from the Octave - General mailing list archive at Nabble.com.
- Newbie - Common value patterns in many vectors,
thombark <=