help-octave
[Top][All Lists]
Advanced

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

Re: "fread" help


From: ivan
Subject: Re: "fread" help
Date: Tue, 26 Apr 2005 14:47:18 +0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510

ivan wrote:

ivan wrote:

Hi,
I am a newhand to the Octave. I saw from the document that the built-in
function "fread" can read data from file. And I bulit a data file named
decimal.txt . The file contents are 1,2,3,4,5 .
I type the following command under Octave:

octave:11> index=fopen("decimal.txt")
index =
{
id = 3
name = decimal.txt
mode = r
arch = native
status = 1
}
octave:12> [data,count]=fread(index,5,"int")
data =

171051569
171182643

count = 2
octave:13> [data,count]=fread(index,5,"int")
data =

0
0
0
0
0

count = 0
Obviously the result is different from that I imagine.
The first question of mine is why the first time "fread" get such
resulst ? If I have wrongly used the arguments of the function ?
The second question of mine is why the two times result are different ?
I will appreciate for your help and advice !
Thanks !
B/R
Ivan



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



Hi,
  I have received all your help and advice . Thanks very much.
But now , If I have a data file whose contents are Hex, how can I read it in ?
B/R
Ivan




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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