bugGNU Octave - Bugs: bug #43391, stem() gives an error if passed...

 
 

bug #43391: stem() gives an error if passed the result of a logical expression

Submitter:  None
Submitted:  Thu 09 Oct 2014 03:36:01 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.8.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 07 Dec 2014 12:06:41 AM UTC, comment #4: 

I added a bit more to the comment message--Octave style is to state the summary of what was fixed in the first line and then have separate lines detailing how each affected file was modified--and committed it to the development branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/aea099cd1ee7).  Thanks for the patch.  Closing report.

Rik <rik5>
Group administrator
Fri 10 Oct 2014 04:34:47 AM UTC, comment #3: 

Well, right.

(file #32250)

Markus Bergholz <markuman>
Thu 09 Oct 2014 06:49:36 PM UTC, comment #2: 

Instead of 1*x, maybe you just want to say double (x)?

John W. Eaton <jwe>
Group administrator
Thu 09 Oct 2014 06:31:48 PM UTC, comment #1: 

At this point

n = -10:10;
x = n >= 2;


x is logical. When you did (1*x), the datatype has changed to double.

I've attached a quick patch which works in this case. Someone have to write an assert test for it.


(file #32249)

Markus Bergholz <markuman>
Thu 09 Oct 2014 03:36:01 PM UTC, original submission:  

When the result of a logical expression is passed to stem as the y argument this error occurs:

n = -10:10;
x = n >= 2;
stem(n, x);
error: invalid value for array property "ydata"
error: called from:
error:   /usr/local/octave/3.8.0/share/octave/3.8.0/m/plot/draw/private/__stem__.m at line 135, column 7
error:   /usr/local/octave/3.8.0/share/octave/3.8.0/m/plot/draw/stem.m at line 127, column 8

The strange thing is that the graph gets plotted correctly, but the execution of the program stops.
If you do this:

stem(n, 1*x)

no error occurs.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #32250:  43391-2.patch added by markuman (943B - text/x-patch)
file #32249:  43391-1.patch added by markuman (933B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by markuman (Updated the item)
  • -email is unavailable- added by None (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.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-12-07 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2014-11-02 mtmiller StatusNone Patch Submitted
        Operating SystemMac OS Any
    2014-10-10 markuman Attached File- Added 43391-2.patch, #32250
    2014-10-09 markuman Attached File- Added 43391-1.patch, #32249

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code