How can I find the intersection between two interpolation functions?

data1 = Table[10*x, {x, 0, 10, 1}]
data2 = Table[-10*x, {x, -10, 2, 1}]

intdata1 = Interpolation[data1];
intdata2 = Interpolation[data2];

ListLinePlot[{data1, data2}]

Solve[intdata1[x] == intdata2[x], x]

This doesn't work, with an error of

Solve::nsmet: This system cannot be solved with the methods available to Solve.


1 Answer 1

In[9]:= x/.FindRoot[intdata1[x]==intdata2[x],{x,3}]
Out[9]= 6.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.