Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Split a monotonic array
Date: Mon, 20 Oct 2008 14:01:18 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 18
Message-ID: <gdi2ve$cv1$1@fred.mathworks.com>
References: <gdg54q$3e1$1@fred.mathworks.com> <gdhtkr$g3c$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1224511278 13281 172.30.248.37 (20 Oct 2008 14:01:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 20 Oct 2008 14:01:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:496246

"Jos " <DELjos@jasenDEL.nl> wrote in message <gdhtkr$g3c$1@fred.mathworks.com>...

> > 
> 
> Hi Bruno,
> 
> here is a one-liner
> 
> A = [ 8 17 24 29 33 36 39 45 56 64 ]
> dmax = 20 
> C = mat2cell(A,1,diff(unique([0 floor(interp1(A,1:numel(A),A(1)+d:d:A(end))) numel(A)])))
> 

Hi Jos,

What is your "d"? I tried d=dmax but it does seem to give the same splitting than mine.

Bruno