Do you know any C implementation of the Matlab interp1 function (just ‘linear’ one)? I know one for Java.
Do you know any C implementation of the Matlab interp1 function (just ‘linear’ one)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I have implemented this linear interpolation myself (some of it is written in Spanish, sorry). The function called encuentraValorMasProximo just finds the nearest value (elementoMasProximo) and index (indiceEnVector) to another one (xx[i]), in an array (xD).
The test function could be:
And its outcome:
1 2.000000
2 4.000000
3 6.000000
4 8.000000
5 10.000000
6 12.000000
7 14.000000
8 16.000000
9 18.000000
10 20.000000