Is it possible in Matlab to plot an even piecewise function like:
$ f(x) = \begin{cases} 3t , 0 < t < \pi \\ -3t , -\pi \le t \le 0 \end{cases}$
which has a period of $2\pi$.
I can't seem to find out how to plot a piecewise function properly. I can get it by plotting two separate graphs and by using the hold on capability.
From matlab workspace call function and plot by the following