bugGNU Octave - Bugs: bug #44659, stem does not accept logical inputs

 
 

bug #44659: stem does not accept logical inputs

Submitted by:  None
Submitted on:  Sun 29 Mar 2015 08:39:58 AM UTC  
 
Category: PlottingSeverity: 2 - Minor
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Miljenko JakovljevicOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.4
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.

 

Mon 30 Mar 2015 05:38:16 AM UTC, comment #5:

Okay. I expanded stem to accept logical arguments in this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/185e8dbdaa40). This will be a part of the 4.0 release. Closing report.

Rik <rik5>
Project Administrator
Mon 30 Mar 2015 04:15:52 AM UTC, comment #4:

Matlab r2009b says:

>> stem (1:3, ['A', 'B', 'C'])

??? Error using ==> stem at 40
Error in color/linetype argument.

My newer Matlab has died for some reason, but
I doubt if there has been a change.

Michael Godfrey <godfrey>
Project Member
Mon 30 Mar 2015 01:34:19 AM UTC, comment #3:

Actually, a more interesting test would be if Matlab accepts char values.

If they do, then Octave can just use isreal() to validate inputs. Otherwise, one has to use a combination such as:

Rik <rik5>
Project Administrator
Mon 30 Mar 2015 01:25:17 AM UTC, comment #2:

We can wait for confirmation, but according to Matlab's documentation the acceptable input is

So it looks like logical is accepted. In terms of memory, it might be cheapest to convert any logicals to uint8 (1 byte) rather than double (8 bytes).

Rik <rik5>
Project Administrator
Sun 29 Mar 2015 12:33:33 PM UTC, comment #1:

Hi,

Thanks for your bug report. You are using a pretty old version of Octave. Since then things have changed: 3.8.1 triggers another error message

4.0.0rc1 explicitly says that inputs should be numeric (not boolean as in your example):

Can you check how Matlab handles this example? Do they turn bool into double?

Pantxo Diribarne <pantxo>
Project Member
Sun 29 Mar 2015 08:39:58 AM UTC, original submission:

A = [1,2,3];
B = [0,2,0];
C = (A == B);
stem(A,C);

warning: implicit conversion from matrix to sq_string
error: get: unknown line property 
error: called from:
error: /usr/share/octave/3.6.4/m/plot/private/__line__.m at line 113, column 16
error: /usr/share/octave/3.6.4/m/plot/line.m at line 38, column 5
error: /usr/share/octave/3.6.4/m/plot/private/__plt__.m at line 597, column 12
error: /usr/share/octave/3.6.4/m/plot/private/__plt__.m at line 238, column 14
error: /usr/share/octave/3.6.4/m/plot/private/__plt__.m at line 99, column 17
error: /usr/share/octave/3.6.4/m/plot/plot.m at line 196, column 9
error: /usr/share/octave/3.6.4/m/plot/private/__stem__.m at line 97, column 17
error: /usr/share/octave/3.6.4/m/plot/stem.m at line 81, column 7

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by godfrey (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 30 Mar 2015 05:38:16 AM UTCrik5StatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Mon 30 Mar 2015 01:34:35 AM UTCrik5Severity3 - Normal=>2 - Minor
    Mon 30 Mar 2015 01:31:08 AM UTCrik5SummaryPlotting the result of (==) comparison of two vectors does not plot properly=>stem does not accept logical inputs
    Mon 30 Mar 2015 01:25:17 AM UTCrik5StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1