I have a piecewise function. I want to turn this into a single expression. How can this be accomplished IN MATLAB and what is the general procedure?
$$f(x,t) = \begin{cases} 20e^{-4x^2} & \text{if $0 \leq t \leq T/2,$} \\ 0 & \text{otherwise.} \end{cases}$$
You can write $$f(x,t)=20e^{-4x^2}\Theta(T/2-t), t\in (0,\infty)$$ The Heaviside step function is defined as: $\Theta(z\ge 0)=1, \Theta(z<0)=0.$