From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: dynamic binning?
Date: Mon, 18 Apr 2011 04:15:21 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <iogdsp$8hu$>
References: <iogb44$b5b$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1303100121 8766 (18 Apr 2011 04:15:21 GMT)
NNTP-Posting-Date: Mon, 18 Apr 2011 04:15:21 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:722403

"Jeremy " <> wrote in message <iogb44$b5b$>...
> Hi everyone. Wondering if anyone had any thoughts about this...
> I've got a bunch of sets of discrete data points, with each point in the x-dimension having an intensity in the y-dimension. I want to bin the data, summing the intensities of data points that are binned together. That is straightforward to do.
> But, I want the bins to be non-uniform, meaning that the further to the left on the x-axis, I want the bins to be narrower, and the further to the right on the x-axis, I want the bins to be wider. Anyone have any thoughts on the right way to do this? I'd prefer to avoid discretizing the changes in bin width, meaning that I would prefer to apply a smooth gradient of bin widths.
> Does that make sense?
> Thanks,
> Jeremy
- - - - - - - - -
  It should be relatively easy to devise some function that allows you to create smoothly varying bin widths.  Their accumulated values give the 'edges' data needed for applying 'histc' to your x-dimension data.  The result would be bin counts and bin indices.  From this you can perform the "summing" on y values you need (though I suspect you really want mean values rather than sums.)  (I can foresee the need for 'accumarray' here.)  If you say that with uniform bin widths this is "straightforward", then with varying bin widths this should be equally so.

Roger Stafford