bugGNU Octave - Bugs: bug #35630, fileread returns a column, at odds...

 
 

bug #35630: fileread returns a column, at odds with Matlab response

Submitter:  None
Submitted:  Sun 26 Feb 2012 09:14:48 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  bpabbott
Originator Name:  Terry Duell Originator Email:  -email is unavailable-
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

Mon 27 Feb 2012 12:56:47 PM UTC, comment #6: 

I pushed a slightly different version.

Ben Abbott <bpabbott>
Group Member
Mon 27 Feb 2012 08:15:15 AM UTC, comment #5: 

Ben,
My apologies re comment #4, I assumed we would be talking about a patch for a low level operation, ie compiled code.
I have edited 'fileread.m' and run the test and it now reads the data as expected.
As a result of some other approaches to get around this problem (ie using fscanf) and correspondence with the other party running Matlab, it is possible there may be another file related read problem.
Could you please hold off on pushing your patch for (say) a day or so, until I can clarify whether the problem is only with fileread or affects other read ops as well.

Terry Duell <tduell>
Mon 27 Feb 2012 05:58:39 AM UTC, comment #4: 

Ben,
I'm not sure how to test the changeset. I normally use a built Fedora rpm, or build my own from a Fedora src.rpm, which is what I did to install 3.6.1.
I don't keep an up to date copy of the src repo and build from that.
I would expect that if your patch works for the script and data that I posted, it will work for me as well.

Anonymous
Mon 27 Feb 2012 02:16:18 AM UTC, comment #3: 

The change looks good.  Don't forget that the embedded %!test block needs to be updated because it already was throwing in one transpose to get things to work.

Rik <rik5>
Group administrator
Mon 27 Feb 2012 01:15:42 AM UTC, comment #2: 

I found the testdata file on the mailist (it is now attached).

I've also attached a changeset that works for me.

Terry, if you can confirm the changeset fixes the problem, I'll push it.

(file #25186, file #25187)

Ben Abbott <bpabbott>
Group Member
Mon 27 Feb 2012 12:59:48 AM UTC, comment #1: 

Please attach a "testdata" file

Ben Abbott <bpabbott>
Group Member
Sun 26 Feb 2012 09:14:48 PM UTC, original submission:  

The following code segment returns a column vector and fails to get a useful result in y...

dd=fileread("testdata");
header=dd(1:104);
data=dd(105:end);
y=str2num(data);

On Matlab this code returns a returns a row vector with expected results, i.e correct numeric values,  in y.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #25186:  testdata added by bpabbott (266B - application/octet-stream)
file #25187:  changeset.patch added by bpabbott (532B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tduell (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by jordigh (Updated 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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-06-06 bpabbott StatusPatch Submitted Fixed
    2012-02-27 bpabbott Open/ClosedOpen Closed
    2012-02-27 bpabbott Assigned toNone bpabbott
    2012-02-27 bpabbott Attached File- Added testdata, #25186
        Attached File- Added changeset.patch, #25187
        StatusNeed Info Patch Submitted
        Release3.6.0 dev
        Operating SystemGNU/Linux Any
    2012-02-27 bpabbott StatusNone Need Info
    2012-02-26 jordigh Item GroupIncorrect Result Matlab Compatibility

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code