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: Prof. Dr. Peter Schulz
Subject: Re: behaviour of "save" function by saving int16 vector
Date: Sat, 9 May 2020 08:25:37 +0200

hi Mike

thanks a lot for quick response, now I understand.

I finally managed it with fprintf.

I need a simple human readable format for teaching, where students should be 
able to import and convert data into VHDL models in an easy way 

Kind regards 
Peter 

> Am 09.05.2020 um 04:12 schrieb Mike Miller <address@hidden>:
> 
>> 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



reply via email to

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