Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: does anyone know a
Date: Wed, 2 Jul 2008 22:48:02 +0000 (UTC)
Organization: Univ of Cambridge
Lines: 32
Message-ID: <g4h0j2$nv5$1@fred.mathworks.com>
References: <g4go36$n1h$1@fred.mathworks.com> <g4gvj6$flc$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1215038882 24549 172.30.248.37 (2 Jul 2008 22:48:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 2 Jul 2008 22:48:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 503430
Xref: news.mathworks.com comp.soft-sys.matlab:477257



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!