Skip to content

Cubic spline interpolation for Vector Type x #588

Open
@kongdd

Description

@kongdd
julia> using Interpolations
       # Plots

       # Lower and higher bound of interval
       a = 1.0
       b = 10.0
       # Interval definition
       x = collect(a:1.0:b)
       # This can be any sort of array data, as long as
       # length(x) == length(y)
       y = @. cos(x^2 / 9.0) # Function application by broadcasting
       # Interpolations
       itp_linear = linear_interpolation(x, y)
       itp_cubic = cubic_spline_interpolation(x, y)
ERROR: MethodError: no method matching cubic_spline_interpolation(::Vector{Float64}, ::Vector{Float64})

Closest candidates are:
  cubic_spline_interpolation(::Tuple{Vararg{AbstractRange, N}}, ::AbstractArray{T, N}; bc, extrapolation_bc) where {N, T}
   @ Interpolations C:\Users\kong\.julia\packages\Interpolations\91PhN\src\convenience-constructors.jl:28
  cubic_spline_interpolation(::AbstractRange, ::AbstractVector; bc, extrapolation_bc)
   @ Interpolations C:\Users\kong\.julia\packages\Interpolations\91PhN\src\convenience-constructors.jl:11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions