Interpolation problems

Hello there!
I have a matrix S(N,2) with data and I want to interpolate S[:,2] as a function of S[:,1]. I wrote the following

using DataInterpolations
vm = S[:,2] 
vh = S[:,1] 

im = LinearInterpolation(vm,vh)

It presents no error at the interpolation itself, but when I try to plot im

plotlyjs()
plot(im)

I receive the following error message

BoundsError: attempt to access 400000-element extrapolate(interpolate((::Array{Float64,1},), ::Array{Float64,1}, Gridded(Linear())), Throw()) with element type Float64 at index [2]

I do not understand this error. Does anyone know what is wrong?

You imported DataInterpolations at the top, but your error message comes from Interpolations.jl, which is a separate package. Which are you using?

2 Likes

I was experimenting with both, and that was the error. Apparently, both compiled together generate some confusion. Restarting and running only using DataInterpolations fixed. Thank you!