bugGNU Octave - Bugs: bug #47458, textscan.cc Matlab incompatibility

 
 

bug #47458: textscan.cc Matlab incompatibility

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Fri 18 Mar 2016 07:04:33 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  lachlan
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 25 Mar 2016 03:43:03 PM UTC, comment #6: 
Philip Nienhuis <philipnienhuis>
Group Member
Tue 22 Mar 2016 09:20:25 PM UTC, comment #5: 

Tested on Linux and Windows 7, works fine.

Thanks for fixing, Lachlan.
Will you push & close this report, please?

Philip Nienhuis <philipnienhuis>
Group Member
Tue 22 Mar 2016 09:48:53 AM UTC, comment #4: 

Here is the rebased patch.  Thanks for letting me know where things had moved to.

(file #36723)

Lachlan Andrew <lachlan>
Tue 22 Mar 2016 12:26:20 AM UTC, comment #3: 

This patch fails to apply to the current textscan, it's been integrated into libinterp/corefcn/{file-io,oct-stream}.{cc,h} now. If you have time could you rebase your change onto the current default branch?

Mike Miller <mtmiller>
Group Member
Sun 20 Mar 2016 11:42:22 PM UTC, comment #2: 

Thanks, Philip and Mike.

The attached patch causes a line of  emptyVal  (NaN by default) if the final line didn't have any valid conversions but did match a literal before the first conversion.  I assume that is the required behaviour.

(file #36703)

Lachlan Andrew <lachlan>
Sat 19 Mar 2016 07:06:31 AM UTC, comment #1: 

Just checked after latest batch of textscan cleanups and confirm this is still the same result.

Mike Miller <mtmiller>
Group Member
Fri 18 Mar 2016 07:04:33 PM UTC, original submission:  

With new textscan.cc in dev:

>> textscan (['Empty' char(10)], 'Empty%f %f')
ans =
{
  [1,1] = [](0x1)
  [1,2] = [](0x1)
}


Expected is {NaN, NaN}.

Adding any digit goes some way in the right direction:

>> textscan (['Empty1' char(10)], 'Empty%f %f')
ans =
{
  [1,1] =  1
  [1,2] = NaN
}


Matlab r2016a prerelease gives:
+verbatim-

>> format compact
>> U = textscan (['Empty' char(10)], 'Empty%f %f')

U =
    [NaN]    [NaN]
-verbatim-

Philip Nienhuis <philipnienhuis>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lachlan (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by philipnienhuis (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-25 philipnienhuis StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2016-03-22 lachlan Attached File- Added bug_47458_literal_only.v1.cset, #36723
    2016-03-20 lachlan StatusConfirmed Patch Submitted
        Assigned toNone lachlan
    2016-03-20 lachlan Attached File- Added bug_47458_literal_only.cset, #36703
    2016-03-19 mtmiller StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code