# Interpolation problems

**URL:** <https://discourse.julialang.org/t/interpolation-problems/58631>\
**Category:** General Usage\
**Created:** [April 5, 2021, 5:29pm UTC](https://discourse.julialang.org/t/interpolation-problems/58631 "2021-04-05T17:29:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![leopdsf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leopdsf/32/31008_2.png) [@leopdsf](https://discourse.julialang.org/u/leopdsf)\
**Post date:** [April 5, 2021, 5:29pm UTC](https://discourse.julialang.org/t/interpolation-problems/58631/1 "2021-04-05T17:29:44Z")

</div>

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

```julia
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`

```julia
plotlyjs()
plot(im)

```

I receive the following error message

```julia
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?

---

<div class="post-metadata">

**Author:** ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Post date:** [April 5, 2021, 6:03pm UTC](https://discourse.julialang.org/t/interpolation-problems/58631/2 "2021-04-05T18:03:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![leopdsf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leopdsf/32/31008_2.png) [@leopdsf](https://discourse.julialang.org/u/leopdsf)\
**Post date:** [April 5, 2021, 8:36pm UTC](https://discourse.julialang.org/t/interpolation-problems/58631/3 "2021-04-05T20:36:41Z")

</div>

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!
