Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Generation of random number from Define probability
Date: Thu, 19 Feb 2009 08:09:01 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 15
Message-ID: <gnj42t$1qi$1@fred.mathworks.com>
References: <gnepo2$18j$1@fred.mathworks.com> <gnf7ru$fg5$1@fred.mathworks.com> <gnhrhd$ll7$1@fred.mathworks.com> <gnin8c$35u$1@fred.mathworks.com> <gnj34u$rl2$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1235030941 1874 172.30.248.35 (19 Feb 2009 08:09:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 19 Feb 2009 08:09:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:519338

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <gnj34u$rl2$1@fred.mathworks.com>...

> 
> Hi Roger,
> 
> What about using sort of concatenated bins and data. This should give you
> (m+n)*log(m+n) complexity. Much better than (m*n); but not quite (n*log(m)).
> 
> I also bump into this problem previously, and so far leave my dichotomy search loop un-vectorized.
> 
> Bruno

There is also the INTERP1(..., 'nearest') which in principle can achieve in (n*log(m)), but my experience is this function is poorly implemented for speed.

Bruno