Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Interpolation
Date: Tue, 17 Jul 2007 00:36:36 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 27
Message-ID: <f7h2uj$9fm$1@fred.mathworks.com>
References: <f7g0b4$sbc$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-00-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1184632596 9718 172.30.248.35 (17 Jul 2007 00:36:36 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 17 Jul 2007 00:36:36 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader DŠ\ýíܽ
Xref: news.mathworks.com comp.soft-sys.matlab:419427



<SNIP apparent interpolation...

one of the many solutions

% your dist and input
     d=[
          .01 100
          .02 200
          .03 300
          .09 900
     ];
     in=[
          .01
          .011
          .015
          .025
          .07
          .09
          .091
          .1
     ];
% the engine
     [ix,ix]=histc(in,sort([d(:,1);in(end)+1]));
% the result
     r=[in,d(ix,:)]

us