Interval graph plotting in gnuplot -
i have equation goes this
f(x) = x*10 ; 0 < x <= 10 = x*x + x*10 ; 10 < x < 20
how plot f(x) in 1 graph using gnuplot?
plot [0:20] x <= 10 ? x*10 : x*x + x*10
update: if have more 2 functions, can use approach:
f(x) = x <= 10 ? x \ : x <= 20 ? x**2 \ : x <= 40 ? sqrt(x) \ : x**3
and afterwards,
plot [0:40] f(x)
to clarify, value f(x)
be:
x
ifx
equal or less 10x^2
ifx
greater 10 , equal or less 20- square root of
x
ifx
greater 20 , equal or less 40 x^3
ifx
greater 40
Comments
Post a Comment