help-octave
[Top][All Lists]
Advanced

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

Re: [help] the mean program in statitistical analysis


From: febty febriani
Subject: Re: [help] the mean program in statitistical analysis
Date: Wed, 6 May 2009 15:40:44 +0900


Obviously. I told you your code indexes out of bounds. when `i' gets
large enough,
i*10 + 10 will be over 36000.
 
yes, you are right. I made wrong. I fixed it. There is no error on the terminal
. thanks very much

http://lmgtfy.com/?q=octave+manual

 for this manual, I find the great octave manual from that links


 

without actually testing, I think your code can be simplified like this:

fid=fopen("${year}${month}${day}${hour}${min}${sec}.dat","r");
x=fscanf(fid,"%lf", [8 36000]);
fclose(fid);

x = reshape (x, 8, 10, []);
x = mean (x, 2);

fh2=fopen("${year}${month}${day}${hour}${min}${sec}.1Hzc.dat","w");
fmt = [repmat("%10f ", 1, 10), "\n"];
fprintf (fh2, fmt, x);
fclose (fh2);

I am learning this way.

If you don't want to hard-code the number of lines, write Inf instead
of 36000, that should read the entire input file.

Btw. you should better avoid starting Octave repeatedly in a script
(if possible), because it takes a non-trivial time. It may be
beneficial to put even the outer bash-level loop inside the Octave
code.

Thanks for your advice
. Thanks very much



--

******
febty febriani
Indonesian Institute of Sciences
Research Center for Physics
Kompleks PUSPIPTEK
Serpong, Indonesia, 15314

reply via email to

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