bugGNU Octave - Bugs: bug #34346, Compatibility: str2num

 
 

bug #34346: Compatibility: str2num

Submitter:  Guillaume <gyom>
Submitted:  Tue 20 Sep 2011 06:25:52 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Wont Fix Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 09 Oct 2016 09:36:40 PM UTC, comment #2: 

I guess the criteria has changed, since now Octave behaves like Matlab.

Juan Pablo Carbajal <juanpi>
Group Member
Wed 19 Oct 2011 09:45:54 PM UTC, comment #1: 

As you have pointed out, this is a difference in the interpreter.  In general, Octave is more careful about checking its inputs in the desire to prevent Garbage In/Garbage Out calculations.  In this case, it seems useful to preserve the error behavior when the user has started a comma-separated list of items without the first item.  The missing item is probably due to a typing error and should provoke a warning.  In this case Octave won't try to be compatible with Matlab.

Rik <rik5>
Group administrator
Tue 20 Sep 2011 06:25:52 PM UTC, original submission:  

There is a difference in behaviour between Octave and MATLAB when calling str2num with a string that starts with a comma:


matlab>> str2num(',1,1')
ans =
     1     1



octave> str2num(',1,1')
ans = [](0x0)


This is actually due to difference in the interpreter

matlab>> [,1,1]
ans =
     1     1



octave> [,1,1]
parse error:
  syntax error
>>> [,1,1]
      ^



Guillaume <gyom>

 

(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 juanpi (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by gyom (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-10-19 rik5 StatusNone Wont Fix
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code