help-octave
[Top][All Lists]
Advanced

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

Re: fread : figuring out binary file format


From: Quentin Spencer
Subject: Re: fread : figuring out binary file format
Date: Mon, 11 Sep 2006 13:23:59 -0500
User-agent: Thunderbird 1.5.0.5 (X11/20060808)

Bryan Lepore wrote:
specifically what does "invalid stream number = -1" mean?

Given your example, I'd say it means you didn't pass it a valid file handle.

also, i gather that to use fread, this syntax is OK :

octave:5> fread ("28JUL06G.DAT",Inf,"32*single",0,"ieee-be")

... where "28JUL06G.DAT" is substituted for "fid" or "f" as i read in `help -i fread"

You have to open and close the file (see help fopen for more details--it's very much like in C if you've used file handles in C before). The correct way to do this would be:

fid = fopen("28JUL06G.DAT");
data = fread (fid,Inf,"32*single",0,"ieee-be");
fclose(fid);



Quentin



reply via email to

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