bugGNU Octave - Bugs: bug #60492, [octave forge] (signal) error in...

 
 

bug #60492: [octave forge] (signal) error in clustersegment with input not strictly 0s and 1s

Submitted by:  Geert van Boxtel <geertvanboxtel>
Submitted on:  Sat 01 May 2021 09:23:11 AM UTC  
 
Category:  Octave Forge Package Severity:  2 - Minor
Priority:  3 - Low Item Group:  Unexpected Error or Warning
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Sat 01 May 2021 08:23:08 PM UTC, comment #1: 

Agree, this function could be a little friendlier if the input data is not in the exact form that is expected.

Note that the docs say that the input vector is expected to be entirely ones and zeros. So if you try this instead, you get the expected result:

>> clustersegment (logical (x))
ans =

   2
   4

I would accept patches to make this function automatically convert the input into the expected ones and zeros, using 'logical()' or '!= 0' or '!!', any of these are probably equally efficient.

Mike Miller <mtmiller>
Project Administrator
Sat 01 May 2021 09:23:11 AM UTC, original submission:  

signal v1.4.1
OS: Ubuntu Linux 20.04.2 LTS 64 bit

x = [0, 1.2, 3, -8, 0];
clustersegment(x)
error: clustersegment: =: nonconformant arguments (op1 is 2x1, op2 is 1x3)
error: called from
    clustersegment at line 56 column 30

The error disappears when x is a column matrix instead of a row matrix, but the function then produces the wrong results

>> clustersegment(x')

ans =
{
  [1,1] = [](0x0)
  [1,2] = [](0x0)
  [1,3] = [](0x0)
  [1,4] = [](0x0)
  [1,5] = [](0x0)
}

Correct result should be
ans =

   2
   4

Geert van Boxtel <geertvanboxtel>

 

(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 geertvanboxtel (Submitted the item)
  • -email is unavailable- added by geertvanboxtel
  •  

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

    Only project members can vote.

     

     

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-05-01 mtmiller Severity3 - Normal => 2 - Minor
        Priority5 - Normal => 3 - Low
        StatusNone => Confirmed
        Release5.2.0 => dev
        Summary[octave forge] (signal) error in clustersegment => [octave forge] (signal) error in clustersegment with input not strictly 0s and 1s
    2021-05-01 mmuetzel Carbon-CopyRemoved 102357 => -
    2021-05-01 mmuetzel Summarysignal: error in clustersegment => [octave forge] (signal) error in clustersegment
    2021-05-01 geertvanboxtel Carbon-Copy- => Added geertvanboxtel

    Back to the top


    Powered by Savane 3.6