[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fread using bit8
From: |
Ben Abbott |
Subject: |
Re: fread using bit8 |
Date: |
Thu, 11 Aug 2011 08:29:17 -0400 |
On Aug 10, 2011, at 10:10 PM, Hoffman, Christopher S wrote:
> -----Original Message-----
> From: Ben Abbott [mailto:address@hidden
> Sent: Wednesday, August 10, 2011 6:04 PM
> To: Hoffman, Christopher S
> Cc: address@hidden
> Subject: Re: fread using bit8
>
>> On Aug 10, 2011, at 8:12 PM, Hoffman, Christopher S wrote:
>>
>>> I am trying to use the fread command on bit8 binary data. Octave does not
>>> support that, is there a workaround?
>>
>> I haven't tried to do this before, but if you can provide a complete example
>> for me I (or someone else) can try to debug it, or find a work around.
>>
>> Also please tell us what version of Octave you are running.
>>
>> Ben
>
> Thanks Ben: I will work on an example for you. I am using version 3.2.4.
>
> Chris
Chris, I tried a short example that works for me.
fid = fopen ('fubar.bin', 'wb');
fwrite (fid, magic (5), 'int8');
fclose (fid);
fid = fopen ('fubar.bin','rb');
a = fread (fid, [5,5], 'int8')
fclose (fid);
a =
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
Ben