Hi, i'm working on a project and i'm trying to dissect someone else's code.
They used fscanf and i can't replicate their results. I've tried figuring this out for two weeks but i've been busy and i can't find (but i'm sure there is) a good answer out there.
I would like to take in a simple two dimensional data file either to an array, or using vectors, but i haven't used vectors before.
Any suggestions on how to do this, either using arrays or vectors?
Thanks
Here's some of the data file:
Time,Ampl
-5.00025e-06,0.000212647
-4.99975e-06,0.000187012
-4.99925e-06,0.000125977
-4.99875e-06,5.51758e-05
-4.99825e-06,8.56934e-05
tfreq = atof(argv[1]);
twidth = atof(argv[2]);
npts1 = atoi(argv[4]);
toffs0 = atof(argv[5]); //time offset from beginning of file to start of pulse
toffs1 = atof(argv[6]);//time offset to trigger point
testoff = atof(argv[7]); // times offset for test signal
testamp = atof(argv[8]); // test signal amplitude in V
Npts = npts1;
i=0;
k=Npts;
/* get next higher power of 2, then factor of 2 bigger for cross cor,
we need the extra length for the tail of the CCF */
while((k=k>>1) > 0){
i++;
}
npts = 1 << (i+2);