Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: find function not reporting all column values
Date: Mon, 9 Nov 2009 02:01:05 +0000 (UTC)
Organization: UCLA
Lines: 15
Message-ID: <hd7t51$o4$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257732065 772 172.30.248.38 (9 Nov 2009 02:01:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 9 Nov 2009 02:01:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2083454
Xref: news.mathworks.com comp.soft-sys.matlab:583450


Hi,

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.  

load Mugu_1_Elevations.txt
load Mugu_M1_0_11012009.txt
date=Mugu_M1_0_11012009(:,1);
ht=Mugu_M1_0_11012009(:,7);
elev=Mugu_1_Elevations(:,4);
elev_Mugu=zeros(length(elev),length(date));
for
i=1:1:length(date)
ind=find(elev<ht(i));
inun_Mugu1(ind,i)=1;
end