truncated data using 'save'

Ben Abbott bpabbott at mac.com
Mon Dec 22 09:34:43 CST 2008


On Dec 22, 2008, at 7:10 AM, Sergei Steshenko wrote:

> --- On Sun, 12/21/08, Sergei Steshenko <sergstesh at yahoo.com> wrote:
>
>> From: Sergei Steshenko <sergstesh at yahoo.com>
>> Subject: truncated data using 'save'
>> To: help-octave at octave.org
>> Date: Sunday, December 21, 2008, 1:35 PM
>> Hello All,
>>
>> here is a sample session:
>>
>> "
>> octave:21> output_precision(25);
>> octave:22> output_max_field_width(31);
>> octave:23> foo = 1/3
>> foo =  3.333333333333333148296162562474e-01
>> octave:24> save('-ascii', 'foo.txt',
>> 'foo')
>> octave:25> system('cat foo.txt')
>> 3.33333333e-01
>> ans = 0
>> octave:26> version
>> ans = 3.0.3
>> "
>>
>> - as I can see, output file contains less significant
>> digits than shown on
>> the terminal.
>>
>> Any way to set output precision for the 'save'
>> command ?
>>
>> Thanks,
>>  Sergei.
>>
>>
>
> Well, it looks like 'save_precision' is the function to be used to  
> change
> precision - I came to this tentative conclusion grepping through  
> source
> code, but 'help save' does not mention this at all.
>
> Regards,
>  Sergei.


There are many places in the documentation that could be improved.  
Recently several individuals have made this the focus of their  
contribution. If you are inclined your help would also be appreciated.  
A full changeset is most desirable. However, if you can suggest the  
change to save.m's help text, I expect one of use will be happy to  
take care of the rest.

If you have a copy of the mercurial archive on your computer and have  
a bash shell available I can send you a script that simplifies  
creating changesets for individual files.

Ben




More information about the Help-octave mailing list