BioDeveloper
BioDeveloper

Reputation: 618

How to fit a*e**bx function via gnuplot?

Upon running this code on my file, it fits nothing.

f1(x) = a*e**(b*x)
a = -1
b = 10000
fit f1(x) 'myFile.txt' via a,b
plot 'myFile.txt' with points lc rgb"blue" title ' '

Does gnuplot understand 'e' or do we need to declare its value? i.e. 2.7182.

Upvotes: 1

Views: 16942

Answers (1)

Christoph
Christoph

Reputation: 48430

You must use the exp function for this:

f1(x) = a*exp(b*x)
a = -1
b = 10000
fit f1(x) 'myFile.txt' via a,b
plot 'myFile.txt' with points lc rgb"blue" title ' '

Upvotes: 3

Related Questions