- #1
fluidistic
Gold Member
- 3,926
- 262
I have a data file with 21 values in it, which range from 2 to 10 by integers values.
I would like to know whether it's possible to write a Fortran code to count the number of times a particular value (for instance "6") appear in the file. Let's call x_i the number of times the value i appears in the data file.
Eventually I would like to write in a new text file the following:
So when I plot into gnuplot the data of the file 11, I can check out immediatly whether the data distribution looks like a Gaussian.
I took a numerical analysis course a few years ago, but from what I remember I don't see anything that could help me here.
Do you have any idea?
Thanks.
I would like to know whether it's possible to write a Fortran code to count the number of times a particular value (for instance "6") appear in the file. Let's call x_i the number of times the value i appears in the data file.
Eventually I would like to write in a new text file the following:
Code:
i=0
do while (i.le.21)
write (11,*)i, x_i
i=i+1
end do
So when I plot into gnuplot the data of the file 11, I can check out immediatly whether the data distribution looks like a Gaussian.
I took a numerical analysis course a few years ago, but from what I remember I don't see anything that could help me here.
Do you have any idea?
Thanks.