ons, 07 10 2009 kl. 11:56 +0900, skrev febty febriani:
> If I have command like below :
>
> fh=fopen("$dir/data-1day-1Hz/result-${year}${month}${num}.dat","r");
> y=fscanf(fh,"%lf");
>
> are there any tricks to know number of lines from the input file?
If your file only contains numbers, then you can just use the 'load'
command, which will give you a neatly formated matrix.
If you know the number of numbers in each line, then you can also do
something like
y = fscanf (fh, "%lf", [N, Inf])
where N is the number of numbers per line.
Søren