<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265318</link>
    <title>MATLAB Central Newsreader - find function not reporting all column values</title>
    <description>Feed for thread: find function not reporting all column values</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 Nov 2009 02:01:05 -0500</pubDate>
      <title>find function not reporting all column values</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265318#693116</link>
      <author>Valerie </author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I have two datasets: one on elevation and one on tidal height and want to create a matrix that will give a value of 1 for when the tidal height exceeds elevation and a 0 for when the tidal height is less than or equal to the elevation.  I had a colleague help me to write a script and it works when I run it on two of my datasets, but when I run it on my other datasets, I seem to be missing some values.  For example, one of my elevation datasets has 441 entries and my tidal series is 11090 entries.  When I run my script however, instead of getting something that's 441x11090, I get something that is 359X11090 and I'm not sure where the other 82 rows have disappeared to.  I've pasted in the script I'm using below.  Any suggestions on what might be causing the problem or suggestions for solutions would be greatly appreciated.  Thanks.  &lt;br&gt;
&lt;br&gt;
load Mugu_1_Elevations.txt&lt;br&gt;
load Mugu_M1_0_11012009.txt&lt;br&gt;
date=Mugu_M1_0_11012009(:,1);&lt;br&gt;
ht=Mugu_M1_0_11012009(:,7);&lt;br&gt;
elev=Mugu_1_Elevations(:,4);&lt;br&gt;
elev_Mugu=zeros(length(elev),length(date));&lt;br&gt;
for&lt;br&gt;
i=1:1:length(date)&lt;br&gt;
ind=find(elev&amp;lt;ht(i));&lt;br&gt;
inun_Mugu1(ind,i)=1;&lt;br&gt;
end</description>
    </item>
    <item>
      <pubDate>Mon, 09 Nov 2009 03:22:59 -0500</pubDate>
      <title>Re: find function not reporting all column values</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265318#693128</link>
      <author>TideMan</author>
      <description>On Nov 9, 3:01&#160;pm, &quot;Valerie &quot; &amp;lt;valerie.a.c...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I have two datasets: one on elevation and one on tidal height and want to create a matrix that will give a value of 1 for when the tidal height exceeds elevation and a 0 for when the tidal height is less than or equal to the elevation. &#160;I had a colleague help me to write a script and it works when I run it on two of my datasets, but when I run it on my other datasets, I seem to be missing some values. &#160;For example, one of my elevation datasets has 441 entries and my tidal series is 11090 entries. &#160;When I run my script however, instead of getting something that's 441x11090, I get something that is 359X11090 and I'm not sure where the other 82 rows have disappeared to. &#160;I've pasted in the script I'm using below. &#160;Any suggestions on what might be causing the problem or suggestions for solutions would be greatly appreciated. &#160;Thanks. &#160;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; load Mugu_1_Elevations.txt&lt;br&gt;
&amp;gt; load Mugu_M1_0_11012009.txt&lt;br&gt;
&amp;gt; date=Mugu_M1_0_11012009(:,1);&lt;br&gt;
&amp;gt; ht=Mugu_M1_0_11012009(:,7);&lt;br&gt;
&amp;gt; elev=Mugu_1_Elevations(:,4);&lt;br&gt;
&amp;gt; elev_Mugu=zeros(length(elev),length(date));&lt;br&gt;
&amp;gt; for&lt;br&gt;
&amp;gt; i=1:1:length(date)&lt;br&gt;
&amp;gt; ind=find(elev&amp;lt;ht(i));&lt;br&gt;
&amp;gt; inun_Mugu1(ind,i)=1;&lt;br&gt;
&amp;gt; end&lt;br&gt;
&lt;br&gt;
Why did you change the name of the output matrix from elev_Mugu to&lt;br&gt;
inun_Mugu?&lt;br&gt;
&lt;br&gt;
This line here:&lt;br&gt;
&amp;gt; elev_Mugu=zeros(length(elev),length(date));&lt;br&gt;
is very important because it sets all the data to zero, then the for&lt;br&gt;
loop resets those data that satisfy your criterion to 1.  By changing&lt;br&gt;
the name, you have completely screwed up the routine your colleague&lt;br&gt;
wrote for you.  You need to either change the name back or to change&lt;br&gt;
the above line to:&lt;br&gt;
inun_Mugu=zeros(length(elev),length(date));</description>
    </item>
  </channel>
</rss>

