<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/241409</link>
    <title>MATLAB Central Newsreader - Search matrix for the first closest match</title>
    <description>Feed for thread: Search matrix for the first closest match</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>Sun, 21 Dec 2008 23:54:02 -0500</pubDate>
      <title>Search matrix for the first closest match</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/241409#618310</link>
      <author>Conrad Andrew</author>
      <description>I have a matrix consisting of ephemeris data as below (the ... just means i skipped some data for brevity)&lt;br&gt;
&lt;br&gt;
A =&lt;br&gt;
&amp;nbsp;&amp;nbsp;354.8800&lt;br&gt;
&amp;nbsp;&amp;nbsp;357.7500&lt;br&gt;
&amp;nbsp;&amp;nbsp;0.6500&lt;br&gt;
&amp;nbsp;&amp;nbsp;3.5800&lt;br&gt;
&amp;nbsp;&amp;nbsp;6.5600&lt;br&gt;
&amp;nbsp;&amp;nbsp;...&lt;br&gt;
&amp;nbsp;&amp;nbsp;352.6400&lt;br&gt;
&amp;nbsp;&amp;nbsp;355.7600&lt;br&gt;
&amp;nbsp;&amp;nbsp;358.9400&lt;br&gt;
&amp;nbsp;&amp;nbsp;0.8900&lt;br&gt;
&amp;nbsp;&amp;nbsp;3.7900&lt;br&gt;
&amp;nbsp;&amp;nbsp;6.9000  &lt;br&gt;
&lt;br&gt;
I want to be able to find the index of the first closest match to 6 within the matrix given a specific index to start the search from. Can someone show me an easy way to search the matrix? Is there a function that does this search efficiently?&lt;br&gt;
Thanks! </description>
    </item>
    <item>
      <pubDate>Mon, 22 Dec 2008 00:18:49 -0500</pubDate>
      <title>Re: Search matrix for the first closest match</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/241409#618314</link>
      <author>NZTideMan</author>
      <description>On Dec 22, 12:54=A0pm, &quot;Conrad Andrew&quot; &amp;lt;conr...@gmx.net&amp;gt; wrote:&lt;br&gt;
&amp;gt; I have a matrix consisting of ephemeris data as below (the ... just means=&lt;br&gt;
&amp;nbsp;i skipped some data for brevity)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; A =3D&lt;br&gt;
&amp;gt; =A0 354.8800&lt;br&gt;
&amp;gt; =A0 357.7500&lt;br&gt;
&amp;gt; =A0 0.6500&lt;br&gt;
&amp;gt; =A0 3.5800&lt;br&gt;
&amp;gt; =A0 6.5600&lt;br&gt;
&amp;gt; =A0 ...&lt;br&gt;
&amp;gt; =A0 352.6400&lt;br&gt;
&amp;gt; =A0 355.7600&lt;br&gt;
&amp;gt; =A0 358.9400&lt;br&gt;
&amp;gt; =A0 0.8900&lt;br&gt;
&amp;gt; =A0 3.7900&lt;br&gt;
&amp;gt; =A0 6.9000 =A0&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I want to be able to find the index of the first closest match to 6 withi=&lt;br&gt;
n the matrix given a specific index to start the search from. Can someone s=&lt;br&gt;
how me an easy way to search the matrix? Is there a function that does this=&lt;br&gt;
&amp;nbsp;search efficiently?&lt;br&gt;
&amp;gt; Thanks!&lt;br&gt;
&lt;br&gt;
[dmn,imn]=3Dmin(abs(A(istart:end)-6));&lt;br&gt;
i6=3Dimn + istart - 1;</description>
    </item>
    <item>
      <pubDate>Mon, 22 Dec 2008 00:21:02 -0500</pubDate>
      <title>Re: Search matrix for the first closest match</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/241409#618315</link>
      <author>Roger Stafford</author>
      <description>&quot;Conrad Andrew&quot; &amp;lt;conrad7@gmx.net&amp;gt; wrote in message &amp;lt;gimkuq$l7u$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; .......&lt;br&gt;
&amp;gt; I want to be able to find the index of the first closest match to 6 within the matrix given a specific index to start the search from.&lt;br&gt;
&amp;gt; ......&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;When I see two superlatives specified for a single entity, it always raises a warning flag.  In your particular case the obvious question is, &quot;what makes you think the 'the closest' will be 'the soonest'?&quot;  How do you balance between how close a match the two sets of six have as compared with how far apart in the list they occur?&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
    <item>
      <pubDate>Mon, 22 Dec 2008 00:58:42 -0500</pubDate>
      <title>Re: Search matrix for the first closest match</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/241409#618318</link>
      <author>NZTideMan</author>
      <description>On Dec 22, 1:21=A0pm, &quot;Roger Stafford&quot;&lt;br&gt;
&amp;lt;ellieandrogerxy...@mindspring.com.invalid&amp;gt; wrote:&lt;br&gt;
&amp;gt; &quot;Conrad Andrew&quot; &amp;lt;conr...@gmx.net&amp;gt; wrote in message &amp;lt;gimkuq$l7...@fred.mat=&lt;br&gt;
hworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; .......&lt;br&gt;
&amp;gt; &amp;gt; I want to be able to find the index of the first closest match to 6 wit=&lt;br&gt;
hin the matrix given a specific index to start the search from.&lt;br&gt;
&amp;gt; &amp;gt; ......&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; =A0 When I see two superlatives specified for a single entity, it always =&lt;br&gt;
raises a warning flag. =A0In your particular case the obvious question is, =&lt;br&gt;
&quot;what makes you think the 'the closest' will be 'the soonest'?&quot; =A0How do y=&lt;br&gt;
ou balance between how close a match the two sets of six have as compared w=&lt;br&gt;
ith how far apart in the list they occur?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Roger Stafford&lt;br&gt;
&lt;br&gt;
Yes, Roger, I thought of that too, but try this:&lt;br&gt;
[dmn,imn]=3Dmin(abs([rand(10,1);6;rand(10,1);6;rand(10,1)]-6))&lt;br&gt;
&lt;br&gt;
It always gets the first one.</description>
    </item>
    <item>
      <pubDate>Tue, 21 Jul 2009 02:41:03 -0400</pubDate>
      <title>Re: Search matrix for the first closest match</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/241409#666804</link>
      <author>Conrad Andrew</author>
      <description>NZTideMan &amp;lt;mulgor@gmail.com&amp;gt; wrote in message &amp;lt;626a201d-04a2-4304-a3ef-2e89da6f7ef3@s9g2000prm.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Dec 22, 1:21=A0pm, &quot;Roger Stafford&quot;&lt;br&gt;
&amp;gt; &amp;lt;ellieandrogerxy...@mindspring.com.invalid&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &quot;Conrad Andrew&quot; &amp;lt;conr...@gmx.net&amp;gt; wrote in message &amp;lt;gimkuq$l7...@fred.mat=&lt;br&gt;
&amp;gt; hworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; .......&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I want to be able to find the index of the first closest match to 6 wit=&lt;br&gt;
&amp;gt; hin the matrix given a specific index to start the search from.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ......&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; =A0 When I see two superlatives specified for a single entity, it always =&lt;br&gt;
&amp;gt; raises a warning flag. =A0In your particular case the obvious question is, =&lt;br&gt;
&amp;gt; &quot;what makes you think the 'the closest' will be 'the soonest'?&quot; =A0How do y=&lt;br&gt;
&amp;gt; ou balance between how close a match the two sets of six have as compared w=&lt;br&gt;
&amp;gt; ith how far apart in the list they occur?&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Roger Stafford&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Yes, Roger, I thought of that too, but try this:&lt;br&gt;
&amp;gt; [dmn,imn]=3Dmin(abs([rand(10,1);6;rand(10,1);6;rand(10,1)]-6))&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; It always gets the first one.&lt;br&gt;
&lt;br&gt;
Thanks for your replies. NZTideMan&amp;gt; This is what I needed. I'm sorry it took about 6months to reply to this. I thought I had done so ages ago!</description>
    </item>
  </channel>
</rss>

