help-octave
[Top][All Lists]
Advanced

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

Re: behaviour of "save" function by saving int16 vector


From: Mike Miller
Subject: Re: behaviour of "save" function by saving int16 vector
Date: Fri, 8 May 2020 19:12:19 -0700

On Fri, May 08, 2020 at 23:37:53 +0200, Prof. Dr. Peter Schulz wrote:
> why is octave, when using "save" for writing an int16 vector/matrix with
> -ascii option,
> writing the integer numbers in exponential form and not as plain integer
> numbers?

The 'save -ascii' format is intended for Matlab compatibility and is
extremely limited in what it supports.

For example, Matlab mentions that saving a character vector 'abc' with
the '-ascii' option results in

    9.7000000e+001  9.8000000e+001  9.9000000e+001

> I'd like to adjust this so that I only have pure integer numbers in the file
> like they
> are shown in the workspace window. Is it possible?

If you care about the formatting of the contents of the file, then you
should probably look into other file I/O functions. Have you tried
dlmwrite, fdisp, fprintf, or fputs for example?

Cheers,

-- 
mike

Attachment: signature.asc
Description: PGP signature


reply via email to

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