A very minor improvement for missing values,
0 10 20 30 ([: <: [: #/.~ i.@>:@[EMAIL PROTECTED] , I.) 5 6 7 12 13 21 22 23
28
0 3 2 4 0
0 10 20 30 ([: <: [: #/.~ i.@>:@[EMAIL PROTECTED] , I.) 15 16 17 12 13 21 22
23 28
0 0 5 4 0
0 10 20 30 ([: <: [: #/.~ i.@>:@[EMAIL PROTECTED] , I.) _1 _1 40 40
2 0 0 0 2
Sherlock, Ric wrote:
How about
x=: 0 10 20 30
y=: 5 6 7 12 13 21 22 23 28
#/.~ x I. y
3 2 4
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Saunders, John (TQEH)
Sent: Tuesday, 17 April 2007 17:28
To: [email protected]
Subject: [Jprogramming] RE: Interval Matches
Hi all,
If I have
x=: 0 10 20 30
y=: 5 6 7 12 13 21 22 23 28
How would I get to
3 2 4
A result showing the number of items of y between items of x
No item of y will equal an item of x. I'm currently using a
loop to set up intervals between items of x and then using
+/(interval e. y) to get the number of matches on each iteration; this
is producing the result however having problem working out
how to do it more efficiently. Thanks John
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
--
regards,
bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm