I'm currently working with piecewise functions and I'm trying to find an easy way to define and plot them using a short and straightforward piece of code. I use esc
pwesc to type the piecewise function in the same manner I'd do it on paper, and I used to put
\\InputFormatat the end to obtain a line of code that I can use to define a new function.
This method has worked for me, until I tried to use
x[t_]:=InputForm[pwF]where pwF is the piecewise function typed using the esc
pwesc method. By doing this, I can evaluate the new function
x[t] manually; for example, if I evaluate
x[0.1] I will get 1, or if I evaluate
x[-1] I will get -1. However, when I try to plot the function using
I get an empty frame.