|
OK,
Sorry for being a fool... I'm scanning the newsgroup and
didn't notice the implications of your pchip requirement.
The above link won't be right for you.
If your input vector is evenly spaced, interp1q is still a
good bet.
Also, check whether there is any difference between the
following...
x = blah;
y = blah;
xi = blah_interp_points;
yi = pchip(x,y,xi)
% or
yi = interp1(x,y,xi,'pchip')
My understanding is that they're functionally the same, but
interp1 checks the inputs - so it may take longer to run.
Alternatively, try to think outside the box. I once had code
which unavoidably made a lot of 1D interpolations... I
re-jigged the code so that it did all the necessary
interpolations first, to a fine degree. I saved the lot to a
mat file. Then, whenever I re-ran my code, I just loaded the
mat file, and use linear interpolation on the finely spaced
data.
Keep the faith... there's always another way!
|