Could you please tell me how can I plot functions that looks like:
f(x)=(x-1)^2 for 0 < x < 1
f(x)=(x-8)^2 for 1<=x<=7
f(x)=x for x>7
in gnuplot. (If you could tell how to call such a kind of function in English I try to change the topic to the more appropiate).
You can do it in that way:
f(x)=x<=1 ? -(x-1)**2+1 : x>7 ? (-48)*sin(240)+1+0.5*x : (-(x-1)**2+1)*sin(30*x)+1
plot f(x)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With