On Thu, Sep 18, 2008 at 10:38 AM, Alex Rufon <[EMAIL PROTECTED]> wrote: > [a=: 1 1 2 2 3 5 5 5 > 1 1 2 2 3 5 5 5 > [b=: 3 4 5 5 3 1 2 > 3 4 5 5 3 1 2 > > What I wanted to do was count the number of matching numbers in a that > are in b. So potentially, my result should be: > 1 0 3 3 1 2 2
+/a=/b 1 0 3 3 1 2 2 If the storage costs of that approach are too excessive, you could instead use: a +/@:="1 0 b 1 0 3 3 1 2 2 If either mechanism is not obvious to you (after you review your knowledge of what the symbols mean), please ask, and I would be happy to elaborate. Thanks, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
