- #1
- 2,136
- 2,708
Consider the following function:
$$f(x) = \begin{cases}
1 & \text{when} & -\pi<x<0\\
0 & \text{when} & 0<x<\pi
\end{cases}$$
Beyond ##-\pi## and ##\pi##, the function just repeats itself; it is periodic.
I want to plot this function for values beyond ##-\pi## and ##\pi##. The graph should look something like this:
This answer to a similar question in MATLAB central says I have to use
Any help is appreciated.
$$f(x) = \begin{cases}
1 & \text{when} & -\pi<x<0\\
0 & \text{when} & 0<x<\pi
\end{cases}$$
Beyond ##-\pi## and ##\pi##, the function just repeats itself; it is periodic.
I want to plot this function for values beyond ##-\pi## and ##\pi##. The graph should look something like this:
repmat
, but I can't understand how to use it in my specific case.Any help is appreciated.