fread and fwrite question
- From: "Ken Fleisher" <PT_Ken@xxxxxxx>
- Date: Fri, 31 Mar 2006 13:48:51 -0500
Hello. I was looking at the arithmetic coding files on the file
exchange (http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=5044&objectType=file)
nd I have a question about two of the files--not a question about the
arithmetic coding.
The two files are:
text.txt
and
compressed.txt
When I do:
fid = fopen(text.txt);
theText = fread(fid);
I correctly get the values that represent the text of the file loaded
into the variable theText. But when I do:
fid = fopen(compressed.txt);
theText = fread(fid);
then theText is an empty array! I know that it is not representative
of actual text codes, but shouldn't the file still be read into the
variable and give me an array with values that represent the default
precision of 'uint8'? It won't mean anything, but I didn't expect an
empty array.
Can someone explain to me why theText is an empty array and how I can
read in the binary data from compressed.txt into a variable?
Thanks!
Ken Fleisher
.
- Follow-Ups:
- Re: fread and fwrite question
- From: Randy Poe
- Re: fread and fwrite question
- Prev by Date: Re: indexing of stucture arrays in loops
- Next by Date: Re: please , how does this code work ?
- Previous by thread: Output cell array from Mex into Matlab
- Next by thread: Re: fread and fwrite question
- Index(es):