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


bug #34346: Compatibility: str2num

Submitted by:  Guillaume <gyom>
Submitted on:  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

Add a New Comment (Rich Markup)

You are not logged in

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


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>
Project 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>
Project 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:

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)

    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 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.5