How can I construct an interpolate of unevenly spaced data in Julia, using nearest neighbor interpolation? I took a look at the documentation and typed the following at REPL:
using Interpolations
input = [1.0 60; 1.1 0; 2.0 60; 2.3 0; 4.0 430; 4.05 0]
itp = interpolate(input[:,1], input[:,2], Gridded(Constant()))
Which seemed straightforward to me, but gives:
ERROR: LoadError: MethodError: no method matching interpolate(::Array{Float64,1}, ::Array{Float64,1}, ::Gridded{Constant})
Do I need to convert the Array
s to Vector
s? If so, how? Please tell me there is an easy solution...