Tips (Utility, Computer Language, and etc.)
[gnuplot] print fitting parameter
Struggler J.
2018. 3. 27. 02:10
When you want to get fitting parameters, you can use "print".
However, when we use "fit" in gnuplot, it also prints all iterations of calculation.
It is hard to figure out where is our desired parameter value.
In this case, we can use "set fit quiet" with "print parameter".
Below is the example,
set fit quiet
f(x) = a*exp(-x/b)
list = system("ls |grep *.txt")
i=1
do for[file in list] {
fit f(x) file u 1:2 via a, b
print i*0.01, 1./b #in my case, files are caculated for different argument 0.01*i. I want to get the exponent av a given this arguement, so I print both
i = i+1 #to print proper argument with the exponent, i increases.
}