help-octave
[Top][All Lists]
Advanced

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

Re: writing integer with fwrite


From: David Bateman
Subject: Re: writing integer with fwrite
Date: Tue, 14 Dec 2004 15:20:29 +0100
User-agent: Mutt/1.4.1i

According to address@hidden <address@hidden> (on 12/14/04):
> Hello and thanks for the quick answer,
> 
> But it doesn't solve the problem.
> The statement:
> cnt=fwrite(fid, bytes,'uint32')
> Returns cnt=2, so it uses two uint32 values to store the one variable,
> in Matlab it returns cnt=1, converting the value bytes to a
> 32bit-Integer before writing. I need it to store as a 4byte value when
> using uint32.
> Any ideas?
> I am using the precompiled windows version 2.150 from sourceforge.
> Is this perhaps a known bug?

Use the uint32 from the latest versions of octave (2.1.64 for example)
and cast as uint32 before calling fwrite

cnt=fwrite(fid, uint32(bytes), 'uint32')

D.

-- 
David Bateman                                address@hidden
Motorola CRM                                 +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 1 69 35 77 01 (Fax) 
91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

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