5
votes

I want to fit multiple bounded functions in gnuplot, fitting the bound values as well.

For example:

f(x)=a          (for x < b)

f(x)=a+(x-b)**c (for x > b)

fit f(x) 'data.dat' via a,b,c

Is there a way to do this?

1

1 Answers

3
votes

Hmmm... interesting. Why don't you try the following:

f(x)=(x<b)?a:a+(x-b)**c
fit f(x) 'data.dat' via a,b,c

tested by @george (see comments). Thanks george!