<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252860</link>
    <title>MATLAB Central Newsreader - Help needed with indexing to the first occurrence of a value</title>
    <description>Feed for thread: Help needed with indexing to the first occurrence of a value</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>Thu, 04 Jun 2009 01:54:01 -0400</pubDate>
      <title>Help needed with indexing to the first occurrence of a value</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252860#654547</link>
      <author>Jack </author>
      <description>I have a single column vector &quot;F&quot;. How can I index to the first occurrence of a the value &quot;98&quot;. Only the row at which &quot;98&quot; first occurs is needed (... yes, I am a newbie to matlab). I am having trouble correctly using the find and index functions... Any help would be greatly appreciated. Thanks</description>
    </item>
    <item>
      <pubDate>Thu, 04 Jun 2009 02:23:01 -0400</pubDate>
      <title>Re: Help needed with indexing to the first occurrence of a value</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252860#654549</link>
      <author>Sadik </author>
      <description>You could say&lt;br&gt;
&lt;br&gt;
firstIndex = find(F==98,1);&lt;br&gt;
&lt;br&gt;
&quot;Jack &quot; &amp;lt;use.text.after.underscore.only_jcannon@csu.edu.au&amp;gt; wrote in message &amp;lt;h079fp$166$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have a single column vector &quot;F&quot;. How can I index to the first occurrence of a the value &quot;98&quot;. Only the row at which &quot;98&quot; first occurs is needed (... yes, I am a newbie to matlab). I am having trouble correctly using the find and index functions... Any help would be greatly appreciated. Thanks</description>
    </item>
    <item>
      <pubDate>Thu, 04 Jun 2009 02:37:35 -0400</pubDate>
      <title>Re: Help needed with indexing to the first occurrence of a value</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252860#654550</link>
      <author>Jack </author>
      <description>Hi Sadik,&lt;br&gt;
&lt;br&gt;
Thanks for the reply... i tried your suggestion, however the returned variable is an empty matrix...?&lt;br&gt;
&lt;br&gt;
Jack&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Sadik &quot; &amp;lt;sadik.hava@gmail.com&amp;gt; wrote in message &amp;lt;h07b65$jv8$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; You could say&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; firstIndex = find(F==98,1);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Jack &quot; &amp;lt;use.text.after.underscore.only_jcannon@csu.edu.au&amp;gt; wrote in message &amp;lt;h079fp$166$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I have a single column vector &quot;F&quot;. How can I index to the first occurrence of a the value &quot;98&quot;. Only the row at which &quot;98&quot; first occurs is needed (... yes, I am a newbie to matlab). I am having trouble correctly using the find and index functions... Any help would be greatly appreciated. Thanks</description>
    </item>
    <item>
      <pubDate>Thu, 04 Jun 2009 02:58:51 -0400</pubDate>
      <title>Re: Help needed with indexing to the first occurrence of a value</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252860#654551</link>
      <author>ImageAnalyst</author>
      <description>On Jun 3, 10:37&#160;pm, &quot;Jack &quot;&lt;br&gt;
&amp;lt;use.text.after.underscore.only_jcan...@csu.edu.au&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi Sadik,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks for the reply... i tried your suggestion, however the returned variable is an empty matrix...?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Jack&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &quot;Sadik &quot; &amp;lt;sadik.h...@gmail.com&amp;gt; wrote in message &amp;lt;h07b65$jv...@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; You could say&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; firstIndex = find(F==98,1);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &quot;Jack &quot; &amp;lt;use.text.after.underscore.only_jcan...@csu.edu.au&amp;gt; wrote in message &amp;lt;h079fp$16...@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I have a single column vector &quot;F&quot;. How can I index to the first occurrence of a the value &quot;98&quot;. Only the row at which &quot;98&quot; first occurs is needed (... yes, I am a newbie to matlab). I am having trouble correctly using the find and index functions... Any help would be greatly appreciated. Thanks- Hide quoted text -&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; - Show quoted text -&lt;br&gt;
&lt;br&gt;
------------------------------------------------------------------------------&lt;br&gt;
Then 98 isn't in your array.  Try this:&lt;br&gt;
clc;&lt;br&gt;
close all;&lt;br&gt;
F = randperm(150)&lt;br&gt;
firstIndex = find(F==98,1)</description>
    </item>
    <item>
      <pubDate>Thu, 04 Jun 2009 03:08:02 -0400</pubDate>
      <title>Re: Help needed with indexing to the first occurrence of a value</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252860#654554</link>
      <author>Matt Fig</author>
      <description>ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;8da3ca2b-&lt;br&gt;
&amp;gt; Then 98 isn't in your array. &lt;br&gt;
&lt;br&gt;
At least to fp precision!&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
A = 98&lt;br&gt;
B = 98 + eps(98)&lt;br&gt;
A==B&lt;br&gt;
&lt;br&gt;
Maybe a tolerance for comparison is needed?</description>
    </item>
  </channel>
</rss>

