Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cubic spline interpolation for Vector Type x #588

Open
kongdd opened this issue Mar 22, 2024 · 0 comments
Open

Cubic spline interpolation for Vector Type x #588

kongdd opened this issue Mar 22, 2024 · 0 comments

Comments

@kongdd
Copy link

kongdd commented Mar 22, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant