Re: File
- From: Peter Boettcher <boettcher@xxxxxxxxxx>
- Date: Tue, 09 May 2006 09:57:10 -0400
am <amelie.quinet@xxxxxxxxxxxxxx> writes:
Titus Edelhofer wrote:
"am" <amelie.quinet@xxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:ef348d8.-1@xxxxxxxxxxxxxxxxxxx
I m afraid this question may be very stupid.
But I want to put in a file (fid=fopen('file','wb');
fwrite(array,' ???'); fclose(fid)), an array which contains
integers > 65000 and floating numbers.
So, of course I can not use 'bitN' because floating point numbers
are cut, and I can't use 'double' because integers > 255 are
cut...
I know this question may be stupid ... but is there a solution
Hi Amelie,
what do you mean by "integers>255 are cut"? For the first
31 bits (values around 2e+9) doubles can be used to represent
integers exactly... ?
yes, you're right.
But in fact, I need to use 'bitN' and not double. So the problem is
how to keep floating values.
Where do these requirements come from? Someone says "You must type
'bitN' for a MATLAB format" and also "You must store double precision
data types"? Obviously you can't do both. So you have to be more
specific about what the restrictions really are. Can you scale the
double precision values into 32-bit fixed point? Can you mix writes
the file, so some elements are stored as doubles and others as ints?
Is is for compatibility with some other software? Etc, etc, etc.
--
Peter Boettcher <boettcher@xxxxxxxxxx>
MIT Lincoln Laboratory
MATLAB FAQ: http://www.mit.edu/~pwb/cssm/
.
- Prev by Date: Re: Why doesn't a semicolon supress output
- Next by Date: Re: How to document simulink models
- Previous by thread: Re: File
- Next by thread: Animation in a warndlg ?
- Index(es):
Relevant Pages
|
|