[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Parsing data files in Octave
From: |
Jens Benecke |
Subject: |
Parsing data files in Octave |
Date: |
Tue, 31 Oct 2006 10:24:10 +0100 |
User-agent: |
KNode/0.10.4 |
Hello,
I have a data file (SPICE log) that contains lines like these:
ml_u: l_u=(-101.563dB,0)
ml_o: l_o=(-101.002dB,0)
ml_ges: l_ges=(-103.512dB,0)
ml_rk: l_rk=(-142.705dB,0)
ml_lk: l_lk=(-142.705dB,0)
ml_mk: l_mk=(-107.185dB,0)
mv_w: c_w=(-204.955dB,0)
mr_s: r_s=(1.11031dB,0)
mc4: c4=(-214.573dB,0)
mc_w: c_w=(-204.955dB,0)
mc_m: c_m=(-243.311dB,0)
mc_l: c_l=(-215.746dB,0)
mr_leitung: r_leitung=(7.68303dB,0)
ml_leitung: l_leitung=(-199.576dB,0)
Date: Tue Oct 31 09:43:22 2006
Total elapsed time: 0.547 seconds.
I would like to pipe these through an Octave script to have the dB values
converted to "real" values. (i.e. realval = 10^(dBval/20) )
I tried this script just to parse the values into variables as a first step
and output it:
fid = fopen("2_7_Param_Koppel_1teilig.log", "r");
[matr, count] = fscanf(fid, "%s: %s=(%fdB,0)");
matr
fclose(fid);
but all I get as output is
warning: fopen: default open mode is now binary
error: fscanf: invalid stream number = -1
I also tried using "%s: %s=(%f%s,%i)" as a string to avoid having "dB"
directly behind a variable declaration, to no effect.
Can anybody help me debug this? I'm a bit lost ... =;)
Thanks!
--
Jens Benecke
Please do not carbon copy me, I read the lists I post in!
- Parsing data files in Octave,
Jens Benecke <=