bugGNU Octave - Bugs: bug #35252, incorrect loading of file (file...

 
 

bug #35252: incorrect loading of file (file saved in same octave version)

Submitted by:  None
Submitted on:  Fri 06 Jan 2012 05:24:25 PM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Liesbeth JanssenOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.2.3
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.

 

Fri 06 Jan 2012 06:58:13 PM UTC, comment #2:

Happily this bug has already been fixed, but you will need to upgrade. The 3.2.X series is deprecated and no longer maintained. Please try 3.4.3 or if you want to wait ~2 weeks the 3.6.0 release will be out.

Rik <rik5>
Project Administrator
Fri 06 Jan 2012 05:30:11 PM UTC, comment #1:

Only the variables that are declared global are read incorrectly.

Anonymous
Fri 06 Jan 2012 05:24:25 PM UTC, original submission:

When saving a (binary) file in octave and loading it in the same session, all variables are loaded correctly. Example:

octave:1> octave_path; constants;
octave:2> who
Variables in the current scope:

Ang c0au mAr mCl mLi6 mO18
Debye cm1 mB mCl37 mMg mP
Debye_g98 coulomb mB10 mD mN mS
GHz eV mBe mF mN15 mSi
MHz g_e mBr mH mNa mXe
NA gauss mBr79 mHe mNe second
Vcm1 joule mBr81 mHe3 mNe21 tesla
amu kboltz mC mI mNe22
ans kcal mC13 mK mO
c0 mAl mCa mLi mO17

octave:3> Ang
Ang = 1.8897
octave:4>
octave:4> save('x.mat','-binary')
octave:5> clear all
octave:6> who
octave:7> load('x.mat')
octave:8> who
Variables in the current scope:

Ang c0au mAr mCl mLi6 mO18
Debye cm1 mB mCl37 mMg mP
Debye_g98 coulomb mB10 mD mN mS
GHz eV mBe mF mN15 mSi
MHz g_e mBr mH mNa mXe
NA gauss mBr79 mHe mNe second
Vcm1 joule mBr81 mHe3 mNe21 tesla
amu kboltz mC mI mNe22
ans kcal mC13 mK mO
c0 mAl mCa mLi mO17

octave:9> exit

(all of these variables are floating point numbers; see attached file constants.m)

Now, when starting a new octave session and reloading the file x.mat, some variables are missing (in this example e.g. Ang, amu, c0, ...):

octave:1> who
Variables in the current scope:

ans

octave:2> load('x.mat')
octave:3> who
Variables in the current scope:

Debye c0au mB mCa mMg mO18
Debye_g98 coulomb mB10 mCl37 mN15 mP
GHz g_e mBe mHe3 mNa mSi
MHz gauss mBr mI mNe mXe
NA joule mBr79 mK mNe21 second
Vcm1 kboltz mBr81 mLi mNe22 tesla
ans mAl mC13 mLi6 mO17

However, the missing variable(s) can be loaded correctly if the corresponding variable name is first initialized. Example:

octave:4> Ang
error: `Ang' undefined near line 4 column 1
octave:4> Ang=1
Ang = 1
octave:5> load('x.mat')
octave:6> Ang
Ang = 1.8897
octave:7> who
Variables in the current scope:

Ang ans mAl mC13 mLi6 mO17
Debye c0au mB mCa mMg mO18
Debye_g98 coulomb mB10 mCl37 mN15 mP
GHz g_e mBe mHe3 mNa mSi
MHz gauss mBr mI mNe mXe
NA joule mBr79 mK mNe21 second
Vcm1 kboltz mBr81 mLi mNe22 tesla

(note that only Ang is added, other variables such as amu and c0 are still missing)

The problem seems to be independent of file format; omitting the '-binary' flag, or using e.g. '-v7', makes no difference.

The saving and loading is done in the same version of octave, so this is not a compatibility issue between different versions.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #24749:  constants.m added by None (3KiB - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 06 Jan 2012 06:58:13 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Fri 06 Jan 2012 05:24:25 PM UTCNoneAttached File-=>Added constants.m, #24749

    Back to the top


    Powered by Savane 3.1-cleanup1