bugGNU Octave - Bugs: bug #65478, hist produces nonconformtant...

 
 

bug #65478: hist produces nonconformtant arguments error when input has ndims > 2

Submitter:  Nicholas Jankowski <nrjank>
Submitted:  Mon 18 Mar 2024 03:07:41 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 18 Mar 2024 03:07:41 AM UTC, original submission:  

in Matlab 2023b,

[a,b] = hist([1:5;2:6;3:7;4:8]')

and

[a,b] = hist(permute([1:5;2:6;3:7;4:8]',[1 3 2]))


produce the same output:



a =

     1     0     0     0
     1     1     0     0
     1     1     1     0
     0     0     0     0
     1     1     1     1
     1     1     1     1
     0     0     0     0
     0     1     1     1
     0     0     1     1
     0     0     0     1


b =

    1.3500
    2.0500
    2.7500
    3.4500
    4.1500
    4.8500
    5.5500
    6.2500
    6.9500
    7.6500


  (it behaves as if all columns are reshaped into dim2)


Octave produces an unexpected error:

>> [a,b] = hist(permute([1:5;2:6;3:7;4:8]',[1 3 2]))
error: =: nonconformant arguments (op1 is 1x1, op2 is 1x1)
error: called from
    hist at line 204 column 20


The matlab docs do describe the input x to hist as being a vector or matrix. so supporting x being an array is undocumented, but hist in general has been around and unchanged in matlab for quite some time.  they've not created an object oriented `histogram` they recommend for use over hist, that octave has not yet implemented, and that function accepts n-D arrays for input. 

It seems like it shouldn't be too difficult for hist to also handle n-D arrays.  At a minimum, if that is discouraged, it should give a meaningful error message.

Nicholas Jankowski <nrjank>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nrjank (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code