help-octave
[Top][All Lists]
Advanced

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

problem with matrices operator


From: febty febriani
Subject: problem with matrices operator
Date: Thu, 8 Oct 2009 11:36:56 +0900

Hello everyone,

Maybe my case is trivial thing, but I need your thought for it,
I have the input file like below :

 3.94979789e+06     2.07563383e+08     8.64407341e+07
 1.99802918e+06     1.42889076e+06     5.55725247e+06
 7.69394731e+05     1.04557613e+07     2.34593537e+06
 2.67118351e+06     5.30308365e+06     1.46961852e+06
 2.08552153e+06     5.29665190e+06     9.76369774e+04
......

The file has 2508810 rows.
I want to do the simple matrices operator for my input file, so I  make the octave command like below :

****
fid=fopen("$dir/data-1day-1Hz/fft-${year}${month}.dat","r");
A=fscanf(fid,"%le");

a=A(:,1);
b=A(:,2);
c=A(:,3);

x=c./a;
y=c./b;
z=c./(a.^2+b.^2);

subplot(3,1,1);plot(x);
subplot(3,2,1);plot(y);
subplot(3,3,1);plot(z);
****

But, I met some errors :
error: invalid column index = 2
error: evaluating assignment _expression_ near line 4, column 2

I had no idea what problem is, because when I applied the matrices operator not using input file, it was OK.
maybe, are there some problem with my command?
thanks very much for any helps.


best regards,
febty

--

******
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]