[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Specifying output format with save()

From: Nicholas Jankowski
Subject: Re: Specifying output format with save()
Date: Fri, 26 Feb 2016 15:40:43 -0500

On Fri, Feb 26, 2016 at 1:27 PM, Mike Miller <address@hidden> wrote:
On Fri, Feb 26, 2016 at 13:17:58 +0100, Alberto Luaces wrote:
> Hello,
> is there any way to specify a desired format (width, decimal places)
> when saving variables with save()?
> My problem is that I want to read the file at a later stage with
> Fortran, and it does not allow that the numbers have different widths,
> including spaces.
> I read about save_precision(), but it seems that only decimal places can
> be specified.
> I think I could do what I want with fprintf, but I would like to know if
> there is a much more direct solution using save().

Doubtful. The primary purpose of the save function is to be read by
Octave's load function, not to be compatible with any other formats or
tools. I think fprintf is exactly what you want.

Seems like dlmwrite might be what you want.  I believe you can specify precision, separators, etc.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]