save and load bug.
Ben Abbott
bpabbott at mac.com
Sat Dec 27 20:51:03 CST 2008
On Dec 27, 2008, at 8:50 PM, GARY FORBIS wrote:
> a> I tried a simple version
> >
> > a = -rand (1, 500);
> > save -text test.txt a
> > clear all
> > load test.txt
> > whos a
> >
> > Running both 3.0.3 and the developers sources load() appears to
> work.
> >
> > I you are unable to produce a simple example which demonstrates the
> > problem, can you attach a file that doesn't load so that it may be
> > examined?
> >
> > Ben
>
> I thought I gave it. Here it is again:
>
> a=-0.03597396637549816
> b=[]
> for x=1:500
> b=[b,a]
> save stest b
> load stest
> end
>
> Here it is running:
>
> octave-3.0.3.exe:13> a=-0.03597396637549816
> a = -0.035974
> octave-3.0.3.exe:14>
> octave-3.0.3.exe:14> b=[]
> b = [](0x0)
> octave-3.0.3.exe:15> for x=1:500
> > b=[b,a]
> > save stest b
> > load stest
> > end
> error: load: failed to load matrix constant
> error: load: trouble reading ascii file `stest'
> error: load: reading file stest
> error: evaluating for command near line 15, column 1
> octave-3.0.3.exe:15>
>
> The reason I wrote it that way was because it fails predictably.
> Another version:
>
> a=-0.03597396637549816
> b=[]
>
> for x=1:383
> b=[b,a]
> end
> save stest b
> load stest
> b=[b,a]
> save stest b
> load stest
>
> In this second program the first case loads and the second fails.
I tried your examples again ... they both run without error for Octave
3.0.3 and Octave built from the developers sources.
What do you get when you type "which load" and "which save"?
Ben
More information about the Help-octave
mailing list