patchGNU Octave - Patches: patch #8801, add support for the histogram and...


patch #8801: add support for the histogram and histcounts functions

Submitted by:  None
Submitted on:  Fri 20 Nov 2015 05:47:40 PM UTC  
Votes:  1  
Category: NonePriority: 5 - Normal
Status: Need InfoPrivacy: Public
Assigned to: NoneOriginator Email: -unavailable-
Open/Closed: Open

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sun 20 Nov 2016 08:26:57 PM UTC, comment #3:

In addition, I think "isreal" => "isnumeric" in L.203

Philip Nienhuis <philipnienhuis>
Project Member
Sun 20 Nov 2016 08:25:57 PM UTC, comment #2:

In histcounts I see this stanza in L.201-205:

Shouldn't the if statement check if "binwidth" rather than "binmethod" is real?

(looks like a copy-paste from he switch clause above)

Philip Nienhuis <philipnienhuis>
Project Member
Tue 09 Feb 2016 11:40:39 PM UTC, comment #1:

Lars, thanks for taking the time to write and contribute these functions to Octave!

This submission looks really good, I have not yet tried or tested the new functions, and haven't checked the Matlab description of these functions, but they look well done, including unit tests and proper coding style. Still needs further review and testing for functionality.

Please assign the copyright to yourself in the file header, it should read "Copyright (C) 2015 Lars Winterfeld" (and the "Author" line is not really needed once that change is made).

This patch should also add the new scripts to the files in the appropriate directories, and add a mention of these new functions to the top-level NEWS file for the future 4.2 release.

Mike Miller <mtmiller>
Project Administrator
Fri 20 Nov 2015 05:47:40 PM UTC, original submission:

more sophisticated version of histc and hist.
not yet implemented: category cell arrays as input.

Those are the two new histogram function in Matlab >= 2014 (or so). I used ideas from both the old hist and histc functions.

However, if the bins are uniform spaced (which is often the case, also if automatically determined), then the bin indexes are now calculated in O(N) instead of O(NM), where N is the number of data points and M the number of bins. If not uniform spaced, I use the lookup function, which finds the indexes in O(Nlog(M)), because the bin edges are sorted.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #35507:  histogram+histcounts.hg-export.diff added by None (16KiB - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by eflower3 (Voted in favor of this item)
  • -unavailable- added by mtmiller (Posted a comment)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 1 encouragement so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 17 Oct 2016 10:08:35 AM UTCeflower3Carbon-Copy-=>Added eflower3
    Tue 09 Feb 2016 11:40:39 PM UTCmtmillerStatusNone=>Need Info
    Fri 20 Nov 2015 05:47:40 PM UTCNoneAttached File-=>Added histogram+histcounts.hg-export.diff, #35507

    Back to the top

    Powered by Savane 3.1-cleanup1