[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re:: Reading binary data.
From: |
Randall M. Brannan |
Subject: |
Re:: Reading binary data. |
Date: |
Tue, 31 Jan 95 13:01:59 PST |
> Date: Tue, 31 Jan 95 13:47:17 CST
> From: address@hidden (Vinayak Dutt)
> Subject: Re: Reading binary data.
> To: address@hidden
> Sender: address@hidden
>
> # brannan writes:
> #I'm new to this list so please forgive me for asking a question which
> #may have already been covered. Can Octave read a binary data file?
> # .....................stuff deleted
>
> vinayak replies:
>
> i have used fopen() to open a binary file. fopen() should open any type of
> file,
> not just text file.
>
> you would require octave version 1.1 to read binary files though (using
> fread()).
>
>
>
I'm using version 1.1.0. I'm using the following 2 lines to read the
data:
fid=fopen(data_name,'r');
[data_array,count]=fread(fid,[collumns,rows],'float');
I've tried replacing 'r' with 'rb', 'b', and 'br'. Octave never
complains but, when it returns, count always equals zero and data_array
is always filled with NaN's. This same file reads just fine when I
fopen it with MATLAB and fread it as 'float'. Are there other arguments,
perhaps undocumented, I should be using with Octave?
R. Brannan
- Reading binary data., Randall M. Brannan, 1995/01/31
- Re:: Reading binary data.,
Randall M. Brannan <=