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

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

[Octave-bug-tracker] [bug #58151] find(1:3, list) returns indices greate


From: Doug Strain
Subject: [Octave-bug-tracker] [bug #58151] find(1:3, list) returns indices greater than length(list)
Date: Thu, 9 Apr 2020 21:24:18 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0 Waterfox/56.3

URL:
  <https://savannah.gnu.org/bugs/?58151>

                 Summary: find(1:3, list) returns indices greater than
length(list)
                 Project: GNU Octave
            Submitted by: saintrain
            Submitted on: Fri 10 Apr 2020 01:24:16 AM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Doug Strain
        Originator Email: 
             Open/Closed: Open
                 Release: 5.2.0
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Hi!

day[] is essentially several years worth of [1:365 1:365 1:365 ...]' with lots
of holes. Length is 5556.

find()-ing individual days, thus


find(2 == day)'
ans =
 Columns 1 through 13:
    364    729   1094   1460   1825   2190   2555   2921   3286   3651   4016 
 4382   4747
 Columns 14 and 15:
   5095   5459
>> find(3 == day)'
ans =
 Columns 1 through 13:
    365    730   1095   1461   1826   2191   2556   2922   3287   3652   4017 
 4383   4748
 Columns 14 and 15:
   5096   5460
>> find(4 == day)'
ans =
 Columns 1 through 13:
      1    366    731   1096   1462   1827   2192   2557   2923   3288   3653 
 4018   4384
 Columns 14 through 16:
   4749   5097   5461


returns reasonable index values, but 


find(2:4 == day)'
ans =
 Columns 1 through 11:
     364     729    1094    1460    1825    2190    2555    2921    3286   
3651    4016
 Columns 12 through 22:
    4382    4747    5095    5459    5921    6286    6651    7017    7382   
7747    8112
 Columns 23 through 33:
    8478    8843    9208    9573    9939   10304   10652   11016   11113  
11478   11843
 Columns 34 through 44:
   12208   12574   12939   13304   13669   14035   14400   14765   15130  
15496   15861
 Columns 45 and 46:
   16209   16573


returns the correct indices for 2, but 3's have length(day) added, and 4's
have 2*length(day). This is unexpected (by me :-)

Thanks 
Doug




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58151>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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