Thanks, Bill, but your "a I. 152" solution only looks forward and not backward. Additionally (and even more important, although I didn't state it but sort of implied it), it doesn't account for the matching RANGE. In other words, the given solution would match the NEXT element in the array, even though it may be out of range. Of course, I realize that you stated, "This may not solve exactly your problem". Your solution was interesting, however, and I'll have to keep it in mind for possible future use. Thanks!
Thanks, Henry, but your solution below removes the matching item(s) and returns the remainder of the array. What I'm looking for is a boolean array containing 1's for the close matches, if any. In other words, given the conditions of the original example: if the array contains: ... 133 139 153 159 165 ... then the returned list contains: ... 0 0 1 1 0 ... for use with the "copy" (#) command OR the returned array might contain only the matching positions (13 14, for example). Does does this clarify what I'd like to be able to do? Thanks! Harvey > x (] #~ 7 < |@:-) y > > Henry Rich > > On 12/26/2010 8:51 PM, PackRat wrote: > > I'm just learning about the .e primitive, and I was wondering how I do > > a match when a close (but not exact) match is involved. In other > > words, how do I do the equivalent of this: > > > > ( a +/- b ) .e y > > > > where the value of b might be, say, 5 or 8 or 12 or whatever (not some > > near-zero tolerance factor). > > > > For example, when matching an element of array a having a value of 152 > > with a match range of +/- 7 and the values of y close to that might be > > ... 133 139 153 159 165 ..., how do I obtain the value 153 from y as a > > "match" (that is, a boolean true)? > > > > Thanks in advance for your help! > > > > Harvey > > > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm