【发布时间】:2020-01-31 03:55:09
【问题描述】:
如何在 Julia 中使用最近邻插值构造不均匀间隔数据的插值?我查看了the documentation 并在 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()))
这对我来说似乎很简单,但给出了:
错误:LoadError:MethodError:没有方法匹配 interpolate(::Array{Float64,1}, ::Array{Float64,1}, ::Gridded{Constant})
我需要将Arrays 转换为Vectors 吗?如果是这样,怎么做?请告诉我有一个简单的解决方案...
【问题讨论】:
标签: julia interpolation