From help-octave-request at che dot utexas dot edu Tue Jan 31 15:21:32 1995 Subject: Re:: Reading binary data. From: vdp at us0 dot mayo dot EDU (Vinayak Dutt) To: help-octave at che dot utexas dot edu Date: Tue, 31 Jan 95 15:20:55 CST # # 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? # just check fid after fopen(), its is not null (0), then fopen() did succeed. also, your usage is correct. i have written a function to read an image format into octave which uses fread() in similar way. i don't see any errors what so ever. it reads correct number of elements and puts them in the returned matrix. by the way, i had compiled octave locally on SunOS4.1.3 with gcc-2.6.0 and Sun F77-2.0.1. --vinayak- /* * vinayak dutt * graduate student, ultrasound research * mayo graduate school, rochester mn * * e-mail: vdp at mayo dot edu * dutt dot vinayak at mayo dot edu * */ #include "disclaimer.h"