4.75

4.8 | 4 ratings Rate this file 142 downloads (last 30 days) File Size: 2.53 KB File ID: #11

bindex.m

by John D'Errico

 

12 Nov 1999

Code covered by BSD License  

BINDEX solves the binning problem.

Download Now | Watch this File

File Information
Description

BINDEX solves the binning problem. (i.e. For any set of bins on the real line, and a set of points relative to those bins, determine the index of the bin each point falls in.) There are several good algorithms available for this problem, so BINDEX chooses the algorithm which is likely to perform best as a function of both the number of bins and the number of points to sort into the bins. For maximum flexibility, BINDEX allows the user to optionally specify the choice of algorithm.

MATLAB release MATLAB 5.2 (R10)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
02 Nov 2005 sergiod dominguez

good

10 Apr 2007 A B

Thanks for this thoughtful function. M-Lint Code Check provides a few simple comments for this function which can probably be used to optimize it. So many years have passed since this function was first submitted, but I still don't know of any other that does the job!

10 Apr 2007 A B  
11 Dec 2007 Remus SEPP

Excellent stuff - I don't understand why is so hard for Matlab people to implement something like this, or even more: some basic data manipulation functions.

12 Dec 2007 S T

Thanks! This kind of function is very handy. I think Matlab people should think about including such a function.

15 Feb 2008 Jim DeWaters

Only problem I have with this is that it uses recursion. No a problem for most but a big problem for me.

03 Nov 2009 Skynet

The built-in function HISTC can also return bin indexes.

Please login to add a comment or rating.
Updates

modifying description

description

updated description

changing description

Tag Activity for this File
Tag Applied By Date/Time
approximation John D'Errico 22 Oct 2008 06:30:11
interpolation John D'Errico 22 Oct 2008 06:30:11
bindex John D'Errico 22 Oct 2008 06:30:11
binning John D'Errico 22 Oct 2008 06:30:11
real line John D'Errico 22 Oct 2008 06:30:11
points John D'Errico 22 Oct 2008 06:30:11
relative John D'Errico 22 Oct 2008 06:30:11
index John D'Errico 22 Oct 2008 06:30:11
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com