help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:: Reading binary data.


From: Vinayak Dutt
Subject: Re:: Reading binary data.
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: address@hidden
 *         address@hidden
 *
 */
#include "disclaimer.h"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]