I need to do some basic interpolation and think Grid.jl should provide all 
the functionality I need, but I can’t quite get it to work for me. 

I am essentially looking to do something like what is described for this 
form of the interp1 matlab function (copied and pasted excerpt from 
documentation):

Vq = interp1(X,V,Xq) interpolates to find Vq, the values of the underlying 
function V=F(X) at the query points Xq. X must be a vector of length N.

A minimal example from the Matlab docs (slightly adapted) of what I would 
like to do is

X = 3:15; 
V = sin(X); 
Xq = 4:.25:12;
Vq = interp1(X,V,Xq);

Here is what I have so far in Julia:

X = [3:15]
V = sin(X);
Xq = [4:.25:12]

ig = InterpGrid(V, BCnil, InterpLinear)

As far as I understand, I can now “index” the ig object to do 
interpolation. The problem I am having is that the portion of the grid I 
would like to interpolate over, Xq, is not represented in terms of indexes, 
but rather points on the interval [minimum(X), maximum(X)].

What do I need to do to evaluate the function underlying ig at the grid 
points Xq?

Reply via email to