Setting piecewise function in gnuplot

I want to install many restricted functions in gnuplot, setting also related values.

For instance:

f(x)=a (for x < b) f(x)=a+(xb)**c (for x > b) fit f(x) 'data.dat' via a,b,c 

Is there any way to do this?

+4
source share
1 answer

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

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

checked by @george (see comments). Thank you George!

+2
source

Source: https://habr.com/ru/post/1435079/


All Articles