<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170647</link>
    <title>MATLAB Central Newsreader - interp3 question?</title>
    <description>Feed for thread: interp3 question?</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, 09 Jun 2008 03:58:01 -0400</pubDate>
      <title>interp3 question?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170647#436420</link>
      <author>Hydroman S</author>
      <description>I have a set of points; say D1 (3x1), Each of these points &lt;br&gt;
is assigned a matrix, F (20 x 3). &lt;br&gt;
&lt;br&gt;
I also have another set of points, say D2 (4 x 1), how can &lt;br&gt;
I interpolate I wish to interpolate F over the set D2.  &lt;br&gt;
&lt;br&gt;
I looked up interp3 and griddatan, but was not able to &lt;br&gt;
accomplish my goal, any tips? </description>
    </item>
    <item>
      <pubDate>Mon, 09 Jun 2008 04:23:47 -0400</pubDate>
      <title>Re: interp3 question?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170647#436423</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;g2i9o9$qsu$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
Hydroman S &amp;lt;amirgsalem@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;I have a set of points; say D1 (3x1), Each of these points &lt;br&gt;
&amp;gt;is assigned a matrix, F (20 x 3). &lt;br&gt;
&lt;br&gt;
&amp;gt;I also have another set of points, say D2 (4 x 1), how can &lt;br&gt;
&amp;gt;I interpolate I wish to interpolate F over the set D2.  &lt;br&gt;
&lt;br&gt;
Perhaps if you gave an example of your data structures?&lt;br&gt;
Most of what you say has left me uncertain about what you want to&lt;br&gt;
do, but rather than point out the possible interpretations, it&lt;br&gt;
would be easier if you gave an example.&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&quot;After all, what problems has intellectualism ever solved?&quot;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-- Robert Gilman</description>
    </item>
    <item>
      <pubDate>Mon, 09 Jun 2008 04:34:01 -0400</pubDate>
      <title>Re: interp3 question?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170647#436426</link>
      <author>Hydroman S</author>
      <description>the example:&lt;br&gt;
&lt;br&gt;
D1=rand(3,1);&lt;br&gt;
F=rand(20,3);&lt;br&gt;
D2=rand(4,1);&lt;br&gt;
&lt;br&gt;
and I wish to interpolate F over the set D2. &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I tried:&lt;br&gt;
&lt;br&gt;
interp1((meshgrid(D1,ones(1,length(F)))),F,D2), but I get &lt;br&gt;
the error: ??? Error using ==&amp;gt; interp1&lt;br&gt;
The values of X should be distinct.</description>
    </item>
    <item>
      <pubDate>Mon, 09 Jun 2008 05:09:01 -0400</pubDate>
      <title>Re: interp3 question?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170647#436428</link>
      <author>Hydroman S</author>
      <description>I also tried interp3 and griddatan to account for the &lt;br&gt;
dimensionality of F, but I also ended up with errors.   </description>
    </item>
    <item>
      <pubDate>Mon, 09 Jun 2008 07:40:52 -0400</pubDate>
      <title>Re: interp3 question?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170647#436436</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;g2ibrp$at0$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
Hydroman S &amp;lt;amirgsalem@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;the example:&lt;br&gt;
&lt;br&gt;
&amp;gt;D1=rand(3,1);&lt;br&gt;
&amp;gt;F=rand(20,3);&lt;br&gt;
&amp;gt;D2=rand(4,1);&lt;br&gt;
&lt;br&gt;
Your original question said that *each* of the points in D1 was&lt;br&gt;
assigned a 20 x 3 matrix, F, but in this example, there is only&lt;br&gt;
-one- 20 x 3 matrix.&lt;br&gt;
&lt;br&gt;
Is each row of D1 associated with a single column of F?&lt;br&gt;
So D1(2) is associated with F(:,2) ? And for any particular D2(K),&lt;br&gt;
you are expecting to produce 20 output values?&lt;br&gt;
&lt;br&gt;
Are the rows of F independant of each other, or is there some kind&lt;br&gt;
of cross-correlation between the rows?&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&quot;Pray do not take the pains / To set me right. /&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;In vain my faults ye quote; / I wrote as others wrote /&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;On Sunium's hight.&quot;                      -- Walter Savage Landor</description>
    </item>
    <item>
      <pubDate>Mon, 09 Jun 2008 08:53:01 -0400</pubDate>
      <title>Re: interp3 question?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170647#436444</link>
      <author>John D'Errico</author>
      <description>&quot;Hydroman S&quot; &amp;lt;amirgsalem@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g2i9o9$qsu$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have a set of points; say D1 (3x1), Each of these points &lt;br&gt;
&amp;gt; is assigned a matrix, F (20 x 3). &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I also have another set of points, say D2 (4 x 1), how can &lt;br&gt;
&amp;gt; I interpolate I wish to interpolate F over the set D2.  &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I looked up interp3 and griddatan, but was not able to &lt;br&gt;
&amp;gt; accomplish my goal, any tips? &lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
You have three points, in a one dimensional&lt;br&gt;
domain space, that map to three function&lt;br&gt;
values. So you use interp1. It so happens that&lt;br&gt;
you have 20 of these relationships to interpolate,&lt;br&gt;
and conveniently for you, interp1 will do them&lt;br&gt;
all in one call. Try it.&lt;br&gt;
&lt;br&gt;
You do not have an n-dimensional problem&lt;br&gt;
that needs a high dimensional interpolation.&lt;br&gt;
&lt;br&gt;
Use interp1.&lt;br&gt;
&lt;br&gt;
John</description>
    </item>
    <item>
      <pubDate>Mon, 09 Jun 2008 11:54:02 -0400</pubDate>
      <title>Re: interp3 question?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170647#436457</link>
      <author>Hydroman S</author>
      <description>Thanks Walter and John.  &lt;br&gt;
&lt;br&gt;
Walter:  &lt;br&gt;
&lt;br&gt;
&amp;gt; Is each row of D1 associated with a single column of F?&lt;br&gt;
&lt;br&gt;
Yes.&lt;br&gt;
&lt;br&gt;
&amp;gt; So D1(2) is associated with F(:,2) ? &lt;br&gt;
&lt;br&gt;
yes.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
And for any particular D2(K),&lt;br&gt;
&amp;gt; you are expecting to produce 20 output values?&lt;br&gt;
&lt;br&gt;
Yes.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Are the rows of F independant of each other, or is there &lt;br&gt;
some kind&lt;br&gt;
&amp;gt; of cross-correlation between the rows?&lt;br&gt;
&lt;br&gt;
Yes the rows of F are independant of each other.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in &lt;br&gt;
message &amp;lt;g2imq4$hd$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt; In article &amp;lt;g2ibrp$at0$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
&amp;gt; Hydroman S &amp;lt;amirgsalem@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt;the example:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;D1=rand(3,1);&lt;br&gt;
&amp;gt; &amp;gt;F=rand(20,3);&lt;br&gt;
&amp;gt; &amp;gt;D2=rand(4,1);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Your original question said that *each* of the points in &lt;br&gt;
D1 was&lt;br&gt;
&amp;gt; assigned a 20 x 3 matrix, F, but in this example, there &lt;br&gt;
is only&lt;br&gt;
&amp;gt; -one- 20 x 3 matrix.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Is each row of D1 associated with a single column of F?&lt;br&gt;
&amp;gt; So D1(2) is associated with F(:,2) ? And for any &lt;br&gt;
particular D2(K),&lt;br&gt;
&amp;gt; you are expecting to produce 20 output values?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Are the rows of F independant of each other, or is there &lt;br&gt;
some kind&lt;br&gt;
&amp;gt; of cross-correlation between the rows?&lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt;   &quot;Pray do not take the pains / To set me right. /&lt;br&gt;
&amp;gt;    In vain my faults ye quote; / I wrote as others &lt;br&gt;
wrote /&lt;br&gt;
&amp;gt;    On Sunium's hight.&quot;                      -- Walter &lt;br&gt;
Savage Landor</description>
    </item>
    <item>
      <pubDate>Mon, 09 Jun 2008 12:12:02 -0400</pubDate>
      <title>Re: interp3 question?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170647#436459</link>
      <author>John D'Errico</author>
      <description>&quot;Hydroman S&quot; &amp;lt;amirgsalem@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g2j5kq$4cl$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Thanks Walter and John.  &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Walter:  &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Is each row of D1 associated with a single column of F?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Yes.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; So D1(2) is associated with F(:,2) ? &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; yes.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; And for any particular D2(K),&lt;br&gt;
&amp;gt; &amp;gt; you are expecting to produce 20 output values?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Yes.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Are the rows of F independant of each other, or is there &lt;br&gt;
&amp;gt; some kind&lt;br&gt;
&amp;gt; &amp;gt; of cross-correlation between the rows?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Yes the rows of F are independant of each other.&lt;br&gt;
&lt;br&gt;
Then read my response. Use interp1.&lt;br&gt;
&lt;br&gt;
John</description>
    </item>
    <item>
      <pubDate>Mon, 09 Jun 2008 12:14:02 -0400</pubDate>
      <title>Re: interp3 question?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170647#436460</link>
      <author>Hydroman S</author>
      <description>John, are you sugessting interpolating over each row of F &lt;br&gt;
in a loop:&lt;br&gt;
&lt;br&gt;
for i=1:length (F)&lt;br&gt;
FNEW(i,:)=interp1(D1,F(i,:),D2')&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;John D'Errico&quot; &amp;lt;woodchips@rochester.rr.com&amp;gt; wrote in &lt;br&gt;
message &amp;lt;g2ir1d$bh9$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Hydroman S&quot; &amp;lt;amirgsalem@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;g2i9o9$qsu$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I have a set of points; say D1 (3x1), Each of these &lt;br&gt;
points &lt;br&gt;
&amp;gt; &amp;gt; is assigned a matrix, F (20 x 3). &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I also have another set of points, say D2 (4 x 1), how &lt;br&gt;
can &lt;br&gt;
&amp;gt; &amp;gt; I interpolate I wish to interpolate F over the set &lt;br&gt;
D2.  &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I looked up interp3 and griddatan, but was not able to &lt;br&gt;
&amp;gt; &amp;gt; accomplish my goal, any tips? &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You have three points, in a one dimensional&lt;br&gt;
&amp;gt; domain space, that map to three function&lt;br&gt;
&amp;gt; values. So you use interp1. It so happens that&lt;br&gt;
&amp;gt; you have 20 of these relationships to interpolate,&lt;br&gt;
&amp;gt; and conveniently for you, interp1 will do them&lt;br&gt;
&amp;gt; all in one call. Try it.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You do not have an n-dimensional problem&lt;br&gt;
&amp;gt; that needs a high dimensional interpolation.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Use interp1.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; John</description>
    </item>
    <item>
      <pubDate>Mon, 09 Jun 2008 12:26:01 -0400</pubDate>
      <title>Re: interp3 question?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170647#436464</link>
      <author>John D'Errico</author>
      <description>&quot;Hydroman S&quot; &amp;lt;amirgsalem@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g2j6qa$gd2$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; John, are you sugessting interpolating over each row of F &lt;br&gt;
&amp;gt; in a loop:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; for i=1:length (F)&lt;br&gt;
&amp;gt; FNEW(i,:)=interp1(D1,F(i,:),D2')&lt;br&gt;
&amp;gt; end&lt;br&gt;
&lt;br&gt;
No. I never said that, although you could&lt;br&gt;
do so. I did state this...&lt;br&gt;
&lt;br&gt;
&amp;gt; It so happens that&lt;br&gt;
&amp;gt; you have 20 of these relationships to interpolate,&lt;br&gt;
&amp;gt; and conveniently for you, interp1 will do them&lt;br&gt;
&amp;gt; all in one call. Try it.&lt;br&gt;
&lt;br&gt;
Does nobody ever believe me? Why would I lie?&lt;br&gt;
&lt;br&gt;
interp1(linspace(0,1,5)',rand(5,6),rand(3,1))&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.77177      0.14707      0.76589      0.81177      0.56821      0.21676&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.8487      0.57487      0.13975      0.57749      0.20276      0.34827&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.85734      0.51283      0.13816      0.69665      0.14793      0.37811&lt;br&gt;
&lt;br&gt;
A one dimensional problem, but here with&lt;br&gt;
6 outputs.&lt;br&gt;
&lt;br&gt;
By the way, if you are seriously interpolating&lt;br&gt;
with only three data points, don't expect a&lt;br&gt;
terribly good prediction.&lt;br&gt;
&lt;br&gt;
John</description>
    </item>
    <item>
      <pubDate>Mon, 09 Jun 2008 12:47:01 -0400</pubDate>
      <title>Re: interp3 question?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170647#436470</link>
      <author>Hydroman S</author>
      <description>this works, thanks John.  I'm a believer now :)&lt;br&gt;
&lt;br&gt;
I guess what was confusing me is that the length of D had &lt;br&gt;
to be equal to the # of columns in F as you show in your &lt;br&gt;
example:&lt;br&gt;
&lt;br&gt;
interp1(linspace(0,1,5)',rand(5,6),rand(3,1))</description>
    </item>
  </channel>
</rss>

