bugGNU Octave - Bugs: bug #48585, hist output does not correspond to...

 
 

bug #48585: hist output does not correspond to Matlab

Submitted by:  Sebastian <sschoeps>
Submitted on:  Thu 21 Jul 2016 05:00:09 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Patch SubmittedAssigned to: None
Originator Name: SebastianOpen/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 25 Jul 2016 06:53:13 AM UTC, comment #2:

MATLAB seems to consider the current behavior not as a bug. It is consistent since 2011a. Example:

[nn,xx] = hist ([1:8], [1 5 3 7]);
assert (xx, [1 5 3 7]);
assert (nn, [3 1 1 3]);

Around 2014b the "single" bug was fixed: "[nn, xx] = hist (y, single (3));" now returns xx as double. uint8 does not work at all in Matlab.

I attach the MATLAB test script that I have used with all version since 2011.

(file #38017)

Sebastian <sschoeps>
Fri 22 Jul 2016 04:46:44 PM UTC, comment #1:

Do we really want to skip the sort if it produces strange (and I assume) incorrect results?

I'm wondering whether the output dimensions consistent between Matlab versions. Maybe we were compatible at one time?

John W. Eaton <jwe>
Project Administrator
Thu 21 Jul 2016 05:00:09 PM UTC, original submission:

Matlab has some strange ideas about "hist.m", e.g.
- the dimension of the return vectors is not well documented (and it's rather inconsistent)
- Matlab does not sort for you if your vector of bins is unsorted (and thus the results maybe unexpected)

I fixed Octave the Octave file to be more like Matlab, see the attached files.

Sebastian

Sebastian <sschoeps>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #38017:  hist_test.m added by sschoeps (3KiB - application/octet-stream)
file #37975:  hist_new.m added by sschoeps (8KiB - application/octet-stream)
file #37976:  hist_patch.m added by sschoeps (3KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Updated the item)
  • -unavailable- added by sschoeps (Submitted the item)
  •  

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

    Only project members can vote.

     

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

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 25 Jul 2016 06:53:13 AM UTCsschoepsAttached File-=>Added hist_test.m, #38017
    Fri 22 Jul 2016 04:33:41 PM UTCjweStatusNone=>Patch Submitted
    Thu 21 Jul 2016 05:00:09 PM UTCsschoepsAttached File-=>Added hist_new.m, #37975
      Attached File-=>Added hist_patch.m, #37976

    Back to the top


    Powered by Savane 3.1-cleanup1