octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #53199] hist returns different results dependi


From: jsh
Subject: [Octave-bug-tracker] [bug #53199] hist returns different results depending on 2nd 1:n/n input argument
Date: Wed, 21 Feb 2018 19:30:25 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0

Follow-up Comment #2, bug #53199 (project octave):

Tested in 2011/2017a and a 15.5 bin center does seem to be generated:


>> a = [  1,  2,  3,  4, 0;
       5,  4,  6,  7, 8;
       9, 12, 11, 10, 0;
      13, 16, 15, 14, 0;
      17, 20, 19, 18, 0;
      21, 22, 23,  2, 0;
      24, 27, 26, 25, 0;
      28, 31, 30, 29, 0;
      32, 35, 34, 33, 0;
      36, 39, 38, 37, 0;
      40, 43, 42, 41, 0;
      44, 47, 46, 45, 0;
      48, 51, 50, 49, 0;
      52, 55, 54, 53, 0];
a = a(:);
b = min (a)
n = max(a)
[cnt1, ctr1] = hist(a, 1:n);
ctr1
[cnt2, ctr2] = hist(a, n);
ctr2
isequal(cnt1,cnt2)

b =

     0


n =

    55


ctr1 =

  Columns 1 through 16

     1     2     3     4     5     6     7     8     9    10    11    12    13
   14    15    16

  Columns 17 through 32

    17    18    19    20    21    22    23    24    25    26    27    28    29
   30    31    32

  Columns 33 through 48

    33    34    35    36    37    38    39    40    41    42    43    44    45
   46    47    48

  Columns 49 through 55

    49    50    51    52    53    54    55


ctr2 =

  Columns 1 through 9

    0.5000    1.5000    2.5000    3.5000    4.5000    5.5000    6.5000   
7.5000    8.5000

  Columns 10 through 18

    9.5000   10.5000   11.5000   12.5000   13.5000   14.5000   15.5000  
16.5000   17.5000

  Columns 19 through 27

   18.5000   19.5000   20.5000   21.5000   22.5000   23.5000   24.5000  
25.5000   26.5000

  Columns 28 through 36

   27.5000   28.5000   29.5000   30.5000   31.5000   32.5000   33.5000  
34.5000   35.5000

  Columns 37 through 45

   36.5000   37.5000   38.5000   39.5000   40.5000   41.5000   42.5000  
43.5000   44.5000

  Columns 46 through 54

   45.5000   46.5000   47.5000   48.5000   49.5000   50.5000   51.5000  
52.5000   53.5000

  Column 55

   54.5000


ans =

  logical

   1



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53199>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]