[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #35252] incorrect loading of file (file saved
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #35252] incorrect loading of file (file saved in same octave version) |
Date: |
Fri, 06 Jan 2012 17:24:26 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101203 SUSE/3.6.13-0.1.1 Firefox/3.6.13 |
URL:
<http://savannah.gnu.org/bugs/?35252>
Summary: incorrect loading of file (file saved in same octave
version)
Project: GNU Octave
Submitted by: None
Submitted on: Fri 06 Jan 2012 05:24:25 PM UTC
Category: Libraries
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: Liesbeth Janssen
Originator Email: address@hidden
Open/Closed: Open
Discussion Lock: Any
Release: 3.2.3
Operating System: GNU/Linux
_______________________________________________________
Details:
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.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Fri 06 Jan 2012 05:24:25 PM UTC Name: constants.m Size: 3kB By: None
<http://savannah.gnu.org/bugs/download.php?file_id=24749>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?35252>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #35252] incorrect loading of file (file saved in same octave version),
anonymous <=