Question: using a condition in a plotting a function

I simplified the real task and

the principal problem is how to assign a condition( if x < 3 then t := 0 elif x >= 3 then t := 5 end if) to a variable t which depends on x (x is a argument of function g(x))?

Is it possible at all without writing the procedure?

Here is the code:

g := proc (x) options operator, arrow; 2*x+t end proc; if x < 3 then t := 0 elif x >= 3 then t := 5 end if; plot(g(x))

Please Wait...