From help-octave-request at che dot utexas dot edu Tue Jan 31 15:02:38 1995 Subject: Re:: Reading binary data. From: brannan at nosc dot mil (Randall M. Brannan) To: help-octave at che dot utexas dot edu Cc: Dutt dot Vinayak at mayo dot EDU, brannan@nosc.mil Date: Tue, 31 Jan 95 13:01:59 PST > Date: Tue, 31 Jan 95 13:47:17 CST > From: vdp at us0 dot mayo dot EDU (Vinayak Dutt) > Subject: Re: Reading binary data. > To: help-octave at che dot utexas dot edu > Sender: help-octave-request at che dot utexas dot edu > > # 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