How to create a function that returns a vector of interpolated values

Hi,
how about this:

function create_interp_func(grid, vals)
    itps = eachrow(vals) .|> v->LinearInterpolation(grid, v, extrapolation_bc = Line())
    return x->[itp(x) for itp∈itps]
end

f = create_interp_func(grid, vals)
f(0.2)

EDIT: I suggest not to use the variable name values, its a predefined name in Julia.

2 Likes