<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171948</link>
    <title>MATLAB Central Newsreader - does anyone know a &quot;faster&quot; interp1?</title>
    <description>Feed for thread: does anyone know a &quot;faster&quot; interp1?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 02 Jul 2008 20:23:02 -0400</pubDate>
      <title>does anyone know a &quot;faster&quot; interp1?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171948#440869</link>
      <author>Roberto Castro</author>
      <description>Hi everyone,&lt;br&gt;
&lt;br&gt;
I have a code in which I heavily use interp1 (with the pchip&lt;br&gt;
option, btw). Does anyone know of a faster interp1? In the&lt;br&gt;
File Exchange, I only found codes for linear or nearest&lt;br&gt;
neighbor interpolation...&lt;br&gt;
&lt;br&gt;
Thanks!!&lt;br&gt;
&lt;br&gt;
PS: I really need to interpolate several times. So, I cannot&lt;br&gt;
use pchip to get the polynomial and just evaluate it later on.</description>
    </item>
    <item>
      <pubDate>Wed, 02 Jul 2008 22:31:02 -0400</pubDate>
      <title>Re: does anyone know a</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171948#440900</link>
      <author>Thomas Clark</author>
      <description>If your input vector is evenly spaced, use interp1q.&lt;br&gt;
&lt;br&gt;
Alternatively, check the file exchange. 10 seconds of search&lt;br&gt;
gives rise to the following:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=10286&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=10286&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
(reconstruct the link if it gets broken)&lt;br&gt;
&lt;br&gt;
Tom Clark</description>
    </item>
    <item>
      <pubDate>Wed, 02 Jul 2008 22:48:02 -0400</pubDate>
      <title>Re: does anyone know a</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171948#440903</link>
      <author>Thomas Clark</author>
      <description>OK,&lt;br&gt;
&lt;br&gt;
Sorry for being a fool... I'm scanning the newsgroup and&lt;br&gt;
didn't notice the implications of your pchip requirement.&lt;br&gt;
The above link won't be right for you.&lt;br&gt;
&lt;br&gt;
If your input vector is evenly spaced, interp1q is still a&lt;br&gt;
good bet.&lt;br&gt;
&lt;br&gt;
Also, check whether there is any difference between the&lt;br&gt;
following...&lt;br&gt;
&lt;br&gt;
x = blah;&lt;br&gt;
y = blah;&lt;br&gt;
xi = blah_interp_points;&lt;br&gt;
&lt;br&gt;
yi = pchip(x,y,xi)&lt;br&gt;
% or&lt;br&gt;
yi = interp1(x,y,xi,'pchip')&lt;br&gt;
&lt;br&gt;
My understanding is that they're functionally the same, but&lt;br&gt;
interp1 checks the inputs - so it may take longer to run. &lt;br&gt;
&lt;br&gt;
Alternatively, try to think outside the box. I once had code&lt;br&gt;
which unavoidably made a lot of 1D interpolations... I&lt;br&gt;
re-jigged the code so that it did all the necessary&lt;br&gt;
interpolations first, to a fine degree. I saved the lot to a&lt;br&gt;
mat file. Then, whenever I re-ran my code, I just loaded the&lt;br&gt;
mat file, and use linear interpolation on the finely spaced&lt;br&gt;
data.&lt;br&gt;
&lt;br&gt;
Keep the faith... there's always another way!</description>
    </item>
    <item>
      <pubDate>Wed, 02 Jul 2008 22:53:02 -0400</pubDate>
      <title>Re: does anyone know a</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171948#440904</link>
      <author>John D'Errico</author>
      <description>&quot;Thomas Clark&quot; &amp;lt;t.clarkremove_spam@cantab.net&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g4gvj6$flc$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; If your input vector is evenly spaced, use interp1q.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Alternatively, check the file exchange. 10 seconds of search&lt;br&gt;
&amp;gt; gives rise to the following:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?&lt;/a&gt;&lt;br&gt;
objectId=10286&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; (reconstruct the link if it gets broken)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Tom Clark&lt;br&gt;
&lt;br&gt;
But neither of these options offers a pchip&lt;br&gt;
interpolation.&lt;br&gt;
&lt;br&gt;
I don't know of any faster methods, although&lt;br&gt;
is your data equally spaced? If so then a&lt;br&gt;
pchip variant could be made more efficient&lt;br&gt;
for that special case.&lt;br&gt;
&lt;br&gt;
John</description>
    </item>
    <item>
      <pubDate>Thu, 03 Jul 2008 05:12:01 -0400</pubDate>
      <title>Re: does anyone know a</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/171948#440938</link>
      <author>Roberto Castro</author>
      <description>&quot;John D'Errico&quot; &amp;lt;woodchips@rochester.rr.com&amp;gt; wrote in&lt;br&gt;
message &amp;lt;g4h0se$qso$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Thomas Clark&quot; &amp;lt;t.clarkremove_spam@cantab.net&amp;gt; wrote in&lt;br&gt;
message &lt;br&gt;
&amp;gt; &amp;lt;g4gvj6$flc$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; If your input vector is evenly spaced, use interp1q.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Alternatively, check the file exchange. 10 seconds of search&lt;br&gt;
&amp;gt; &amp;gt; gives rise to the following:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?&lt;/a&gt;&lt;br&gt;
&amp;gt; objectId=10286&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; (reconstruct the link if it gets broken)&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Tom Clark&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; But neither of these options offers a pchip&lt;br&gt;
&amp;gt; interpolation.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I don't know of any faster methods, although&lt;br&gt;
&amp;gt; is your data equally spaced? If so then a&lt;br&gt;
&amp;gt; pchip variant could be made more efficient&lt;br&gt;
&amp;gt; for that special case.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; John&lt;br&gt;
&lt;br&gt;
I'm afraid the data is not equally spaced...</description>
    </item>
  </channel>
</rss>

