<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164484</link>
    <title>MATLAB Central Newsreader - Interpolating between 2 columns</title>
    <description>Feed for thread: Interpolating between 2 columns</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>Mon, 25 Feb 2008 16:57:02 -0500</pubDate>
      <title>Interpolating between 2 columns</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164484#417190</link>
      <author>Jason </author>
      <description>Hello,&lt;br&gt;
&lt;br&gt;
I have two columns of data&lt;br&gt;
&lt;br&gt;
X1 = 20 21 22 23 at 2&lt;br&gt;
&lt;br&gt;
X2 = 30 31 32 33 at 3&lt;br&gt;
&lt;br&gt;
I want the column of data at 2.5. I'm not sure how to obtain&lt;br&gt;
this using interp commands. &lt;br&gt;
&lt;br&gt;
Thanks in advance.</description>
    </item>
    <item>
      <pubDate>Mon, 25 Feb 2008 17:31:02 -0500</pubDate>
      <title>Re: Interpolating between 2 columns</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164484#417201</link>
      <author>John D'Errico</author>
      <description>&quot;Jason &quot; &amp;lt;j_henderson44@REMOVEhotmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;fpus0u$pgs$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hello,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have two columns of data&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; X1 = 20 21 22 23 at 2&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; X2 = 30 31 32 33 at 3&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I want the column of data at 2.5. I'm not sure how to obtain&lt;br&gt;
&amp;gt; this using interp commands. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks in advance.&lt;br&gt;
&lt;br&gt;
Z = [10 11 12 13;20 21 22 23;30 31 32 33]';&lt;br&gt;
&lt;br&gt;
z25 = interp2(1:3,1:4,Z,2.5,1:4)&lt;br&gt;
z25 =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;25&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;26&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;27&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;28&lt;br&gt;
&lt;br&gt;
HTH,&lt;br&gt;
John</description>
    </item>
    <item>
      <pubDate>Tue, 26 Feb 2008 09:15:03 -0500</pubDate>
      <title>Re: Interpolating between 2 columns</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164484#417335</link>
      <author>Jason </author>
      <description>&quot;John D'Errico&quot; &amp;lt;woodchips@rochester.rr.com&amp;gt; wrote in &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Z = [10 11 12 13;20 21 22 23;30 31 32 33]';&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; z25 = interp2(1:3,1:4,Z,2.5,1:4)&lt;br&gt;
&amp;gt; z25 =&lt;br&gt;
&amp;gt;     25&lt;br&gt;
&amp;gt;     26&lt;br&gt;
&amp;gt;     27&lt;br&gt;
&amp;gt;     28&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; HTH,&lt;br&gt;
&amp;gt; John&lt;br&gt;
&lt;br&gt;
John,&lt;br&gt;
&lt;br&gt;
Thank you for the answer. I should learn to post the more&lt;br&gt;
difficult part of the problem from the start on here ;-) I&lt;br&gt;
always start from a simple problem to understand what is&lt;br&gt;
happening. &lt;br&gt;
&lt;br&gt;
I see you have added an additional row to give the&lt;br&gt;
interpolation matrix that is equally spaced between columns.&lt;br&gt;
&lt;br&gt;
My real problem is that: &lt;br&gt;
&lt;br&gt;
my column data is not equally spaced as your additional&lt;br&gt;
column makes it.&lt;br&gt;
&lt;br&gt;
ie X1 = [20 21 22 23] at 17&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;X2 = [30 31 32 33] at 20&lt;br&gt;
&lt;br&gt;
Jason</description>
    </item>
    <item>
      <pubDate>Tue, 26 Feb 2008 10:35:03 -0500</pubDate>
      <title>Re: Interpolating between 2 columns</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164484#417344</link>
      <author>Jason </author>
      <description>&quot;Jason &quot; &amp;lt;j_henderson44@REMOVEhotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fq0lan$k11$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;John D'Errico&quot; &amp;lt;woodchips@rochester.rr.com&amp;gt; wrote in &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Z = [10 11 12 13;20 21 22 23;30 31 32 33]';&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; z25 = interp2(1:3,1:4,Z,2.5,1:4)&lt;br&gt;
&amp;gt; &amp;gt; z25 =&lt;br&gt;
&amp;gt; &amp;gt;     25&lt;br&gt;
&amp;gt; &amp;gt;     26&lt;br&gt;
&amp;gt; &amp;gt;     27&lt;br&gt;
&amp;gt; &amp;gt;     28&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; HTH,&lt;br&gt;
&amp;gt; &amp;gt; John&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; John,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thank you for the answer. I should learn to post the more&lt;br&gt;
&amp;gt; difficult part of the problem from the start on here ;-) I&lt;br&gt;
&amp;gt; always start from a simple problem to understand what is&lt;br&gt;
&amp;gt; happening. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I see you have added an additional row to give the&lt;br&gt;
&amp;gt; interpolation matrix that is equally spaced between columns.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; My real problem is that: &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; my column data is not equally spaced as your additional&lt;br&gt;
&amp;gt; column makes it.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ie X1 = [20 21 22 23] at 17&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;    X2 = [30 31 32 33] at 20&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Jason&lt;br&gt;
&lt;br&gt;
Ok sorry for the question above. I guess I just need to&lt;br&gt;
redefine the input value as a fraction of 2 and 3. Is this&lt;br&gt;
the best/most logical way? It works but I am keen to follow&lt;br&gt;
good convention. &lt;br&gt;
&lt;br&gt;
Z = [20 21 22 23;30 31 32 33]';&lt;br&gt;
&amp;nbsp;&lt;br&gt;
z25 = interp2(1:2,1:4,Z,fraction,1:4)&lt;br&gt;
&lt;br&gt;
Jason</description>
    </item>
    <item>
      <pubDate>Tue, 26 Feb 2008 13:00:18 -0500</pubDate>
      <title>Re: Interpolating between 2 columns</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164484#417383</link>
      <author>John D'Errico</author>
      <description>&quot;Jason &quot; &amp;lt;j_henderson44@REMOVEhotmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;fq0q0n$hn$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Jason &quot; &amp;lt;j_henderson44@REMOVEhotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;fq0lan$k11$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &quot;John D'Errico&quot; &amp;lt;woodchips@rochester.rr.com&amp;gt; wrote in &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Z = [10 11 12 13;20 21 22 23;30 31 32 33]';&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; z25 = interp2(1:3,1:4,Z,2.5,1:4)&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; z25 =&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;     25&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;     26&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;     27&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;     28&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; HTH,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; John&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; John,&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thank you for the answer. I should learn to post the more&lt;br&gt;
&amp;gt; &amp;gt; difficult part of the problem from the start on here ;-) I&lt;br&gt;
&amp;gt; &amp;gt; always start from a simple problem to understand what is&lt;br&gt;
&amp;gt; &amp;gt; happening. &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I see you have added an additional row to give the&lt;br&gt;
&amp;gt; &amp;gt; interpolation matrix that is equally spaced between columns.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; My real problem is that: &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; my column data is not equally spaced as your additional&lt;br&gt;
&amp;gt; &amp;gt; column makes it.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; ie X1 = [20 21 22 23] at 17&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;    X2 = [30 31 32 33] at 20&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Jason&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Ok sorry for the question above. I guess I just need to&lt;br&gt;
&amp;gt; redefine the input value as a fraction of 2 and 3. Is this&lt;br&gt;
&amp;gt; the best/most logical way? It works but I am keen to follow&lt;br&gt;
&amp;gt; good convention. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Z = [20 21 22 23;30 31 32 33]';&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; z25 = interp2(1:2,1:4,Z,fraction,1:4)&lt;br&gt;
&lt;br&gt;
Interp2 does not need equal spacing, and&lt;br&gt;
I could have written it with only two columns.&lt;br&gt;
I misinterpreted your original question, so&lt;br&gt;
for some silly reason I added a column.&lt;br&gt;
&lt;br&gt;
Z = [20 21 22 23;30 31 32 33]';&lt;br&gt;
z25 = interp2([17 20],1:4,Z,18.5,1:4)&lt;br&gt;
&lt;br&gt;
John</description>
    </item>
  </channel>
</rss>

