Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to identify "intersections" between to data sets?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69218] Re: How to identify "intersections" between to data sets?
  • From: "dkr" <dkrjeg at adelphia.net>
  • Date: Fri, 1 Sep 2006 18:41:40 -0400 (EDT)
  • References: <ed93aj$qjp$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Doug,

In[12]:=
Set1 ={{1.01,5},{2.1,4},{4.3,4}};
Set2 ={{1.02,4},{3,8},{4.305,8}};
err=0.15;  (*
  two numbers are considered equal if they are within err of one
another *)
In[15]:=
Intersection[Set1,Set2,SameTest->(Abs[First[#1]-First[#2]]<err&)]
Out[15]=
{{1.01,5},{4.3,4}}
In[16]:=
(* Extract the x values if you like  *)
%[[All,1]]
Out[16]=
{1.01,4.3}

dkr


  • Prev by Date: Problem with using /.
  • Next by Date: Please help: How to use Mathematica to get Parametric solution for a transcendental equation?
  • Previous by thread: How to identify "intersections" between to data sets?
  • Next by thread: RE: How to identify "intersections" between to data sets?