bugGNU Octave - Bugs: bug #47909, load and += does not add

 
 

bug #47909: load and += does not add

Submitter:  Y Iwasaki <oct4020160521>
Submitted:  Thu 12 May 2016 02:46:52 PM UTC
   
 
Category:  Interpreter Severity:  4 - Important
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Duplicate Assigned to:  None
Originator Name:  Iwasaki Y Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 12 May 2016 05:12:59 PM UTC, comment #3: 

Marking as a duplicate

Rik <rik5>
Group administrator
Thu 12 May 2016 05:00:08 PM UTC, comment #2: 

This is essentially the same as bug #47676.  There is more discussion there.

John W. Eaton <jwe>
Group administrator
Thu 12 May 2016 04:54:13 PM UTC, comment #1: 

Confirmed.  This bug exists for the current stable version of Octave (4.0.2) as well as on the development branch.

The bug is not specific to the file format used to save the variable 'a'.  I have used Octave's own binary and text formats and the errors are the same.  The bug is specific to executing the lines within an m-file.  I have tried both the original file, which is actually just a script.  I have also tried wrapping the script lines within function/endfunction and calling b42(), but that fails as well.

The error on line 2 comes from using the in-place += operator.  If I use the line


a = a + 1;


then the code also works.  It would appear that the row/column indices for the += operation are not being generated correctly because on the development branch I get the slightly more informative error


error: a(61,_): but a has size 10x10


It is clear that Octave knows the size is 10x10.

Rik <rik5>
Group administrator
Thu 12 May 2016 02:46:52 PM UTC, original submission:  

Prepare script "b42.m" as following three lines

load "data4.mat";
a += 1;
a(1,1)


Start Octave and type following two lines

a=ones(61,49);
save "data4.mat" a


Exit Octave and restart Octave and type

b42


Octave shows
ans =  1

a(1,1) should be 2.
Changing a=ones(61,49) to a=ones(10,10) results in
error: b42: A(I,J): row index out of bounds; value 61 out of bound 10
error: called from
    b42 at line 2 column 1




Y Iwasaki <oct4020160521>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by oct4020160521 (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-05-12 mtmiller Open/ClosedOpen Closed
    2016-05-12 rik5 StatusConfirmed Duplicate
    2016-05-12 rik5 Dependencies- Depends on bugs #47676
    2016-05-12 rik5 Severity3 - Normal 4 - Important
        StatusNone Confirmed
        Release3.8.2 dev
        Summaryload and += doesnot add load and += does not add

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code