[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Save-load problem
From: |
Henry F. Mollet |
Subject: |
Re: Save-load problem |
Date: |
Tue, 29 Apr 2003 11:18:19 -0700 |
User-agent: |
Microsoft-Entourage/10.1.1.2418 |
Thanks you. Saving with the float-binary option works for me also. Also
thanks to Iago for Add default_save_format="ascii"; to ~/.octaverc
But I still don't understand. If it were a matter of loosing precision,
would not the elements of vector A be a little different. When I compared
the 128th element they were identical to 5 digits (24.93639), Saving and
re-loading just dropped the 129th element (Column 129: 25.13274).
Henry
on 4/29/03 10:24 AM, Pablo Barrera González at address@hidden wrote:
> El mar, 29-04-2003 a las 19:05, Henry F. Mollet escribió:
>> I've tried an introductory example in an MATLAB textbook and used Octave to
>> check. Saving and reloading is changing the size of A. Why and how would I
>> avoid this problem?
>> Henry
>>
>
> This error it's due to the way how octave save ascii files. In order to
> save space (I guess) in your example:
>> GNU Octave, version 2.1.35 (powerpc-apple-darwin6.2).
>> Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 John W. Eaton.
>>
>> octave:1> A = 0:pi/16:8*pi;
>> octave:2> whos
>>
>> *** local user variables:
>>
>> prot type rows cols name
>> ==== ==== ==== ==== ====
>> rwd range 1 129 A
>>
>
> Octave save this file:
>
> # Created by Octave 2.0.16.92, Tue Apr 29 17:19:46 2003 <address@hidden>
> # name: A
> # type: range
> # base, limit, increment
> 0 25.1327412287183 0.196349540849362
>
> And it looses presition.
>
> In my machine I used save with the float-binary option:
>
> address@hidden:/tmp$ octave2.0
> GNU Octave, version 2.0.16.92 (i386-pc-linux-gnu).
> Copyright (C) 1996, 1997, 1998, 1999, 2000 John W. Eaton.
> This is free software with ABSOLUTELY NO WARRANTY.
> For details, type `warranty'.
>
> octave2.0:1> A = 0:pi/16:8*pi;
> octave2.0:2> whos
>
> *** local user variables:
>
> prot type rows cols name
> ==== ==== ==== ==== ====
> wd range 1 129 A
>
> octave2.0:3> save -float-binary session3.mat
> octave2.0:4> clear
> octave2.0:5> whos
> octave2.0:6> load session3.mat
> octave2.0:7> whos
>
> *** local user variables:
>
> prot type rows cols name
> ==== ==== ==== ==== ====
> wd range 1 129 A
>
>
> And it seems to work. I don't know how to force octave for saving the
> entire list of values in ascii.
>
> HTH
>
>
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- Save-load problem, Henry F. Mollet, 2003/04/29
- Re: Save-load problem,
Henry F. Mollet <=
- Re: Save-load problem, John W. Eaton, 2003/04/29
- Re: Save-load problem, Przemek Klosowski, 2003/04/29
- Re: Save-load problem, Henry F. Mollet, 2003/04/29
- Re: Save-load problem, Francesco Potorti`, 2003/04/30
- Re: Save-load problem, Paul Kienzle, 2003/04/30
- Re: Save-load problem, Mike Miller, 2003/04/30