octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #48408] Changing a variable and saving file wi


From: anonymous
Subject: [Octave-bug-tracker] [bug #48408] Changing a variable and saving file with -append in Octave makes it impossible to load a particular variable in MATLAB
Date: Tue, 5 Jul 2016 12:26:45 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?48408>

                 Summary: Changing a variable and saving file with -append in
Octave makes it impossible to load a particular variable in MATLAB
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Tue 05 Jul 2016 12:26:43 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.3
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

In MATLAB R2015a (under Ubuntu 12.04) I created a mat file so that I could
read it in Octave:
>> a=1;
>> save('datafile.mat', 'a', '-v7');

I then created a matrix and added it to the file:
>> b=zeros(2,2);
>> save('datafile.mat', 'b', '-append', '-v7');

In Octave 4.0.3 I loaded the file, changed the contents of b and saved the
modified version to file.
load('datafile.mat');
> b(1,1)=1;
> save('datafile.mat', 'b', '-append', '-v7');

Back in MATLAB, I tried to load the variable from the file:
>> load('datafile.mat', 'b')
>> b
b =
     0     0
     0     0

It loads the first version of b.
If I load the full file, it loads correctly:
>> load('datafile.mat')
>> b
b =
     1     0
     0     0

Of course, one might argue that this is a MATLAB bug, but the same code in
MATLAB produces the correct result.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48408>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]