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$>
References: <gnepo2$18j$> <gnf7ru$fg5$> <gnhrhd$ll7$> <gnin8c$35u$> <gnj34u$rl2$>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1235030941 1874 (19 Feb 2009 08:09:01 GMT)
NNTP-Posting-Date: Thu, 19 Feb 2009 08:09:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: comp.soft-sys.matlab:519338

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

> 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.