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

Integral on matrix interpolations throws method error #124

Open
afod22 opened this issue Sep 16, 2022 · 0 comments
Open

Integral on matrix interpolations throws method error #124

afod22 opened this issue Sep 16, 2022 · 0 comments

Comments

@afod22
Copy link

afod22 commented Sep 16, 2022

Integral on matrix interpolations throws error

Integral is defined for any AbstractInterpolation but then calls samples on that interpolation which only has methods for ::LinearInterpolation{<:AbstractVector} types.

It would be useful to be able to get the integral of multi-dimensional interpolations. Derivetives returns a vector with element for each data dimension. Integral could do the same though this may not be a useful output for every use case.

I'd like to be able to use this to calculate means and standard deviations for each signal in an interpolation.

Example code:

u = rand(3,20)
t = sort(rand(20))

X1 = LinearInterpolation(u[1,:],t)
DataInterpolations.integral(X1, 0, 0.5) # Works

X = LinearInterpolation(u,t)
# MethodError: no method matching samples(::LinearInterpolation{Matrix{Float64}, Vector{Float64}, true, Float64})
DataInterpolations.integral(X, 0, 0.5)

Thanks,

Aaron.

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