Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Help with a Tricky For Loop
Date: Thu, 8 Oct 2009 23:29:18 +0000 (UTC)
Organization: Battelle Energy Alliance (INL)
Lines: 14
Message-ID: <halske$kj0$1@fred.mathworks.com>
References: <hal464$dru$1@fred.mathworks.com> <hal82q$pq$1@news.eternal-september.org>
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 1255044558 21088 172.30.248.38 (8 Oct 2009 23:29:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 8 Oct 2009 23:29:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 688530
Xref: news.mathworks.com comp.soft-sys.matlab:576087

dpb <none@non.net> wrote in message <hal82q$pq$1@news.eternal-september.org>...
> Try this...
> 
>  >> a = [2 4; 3 5; 6 7; 6 9];
>  >> d = [zeros(1,size(a,2)); diff(a,1)];
>  >> b= a(r(:,1)<2 & r(:,2)>0,:)
> b =
>       3     5
>       6     9
>  >>
> 


Hmm, I took this completely differently.  But since the OP hasn't replied, maybe you're correct.