Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

For example, I have the following list:

AA={{0, 20000.}, {26.6, 19950.}, {53.2, 19950.}, {79.8, 
  19950.}, {97.1198, 18644.1}, {102.681, 16452.3}}

Another calculation results in an arbitrary value intended for the first part of the list, let's say 21.3. By interpolating linearly, this results in a value of 19960 for the second part of the list.

How can I import this in Mathematica?

share|improve this question
    
what would an improvement look like? What value would you expect? –  user21 Jul 24 '13 at 17:57
    
I would expect an value of 19960 (In case of 21.3 in the first part of the list), but I don't know how to program this in Mathematica.. –  Paus Jul 24 '13 at 18:04

1 Answer 1

If you use an InteprolationOrder->1 things work as you expect:

if = Interpolation[AA, InterpolationOrder -> 1];
if[21.3]
(*19960.*)
share|improve this answer
    
Thank you ruebenko –  Paus Jul 24 '13 at 18:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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