### 21.1.1 Boxcar function

The boxcar command creates a function which has the value 1 in a given interval, and otherwise 0.

- boxcar takes three arguments:
  - a,b, two real numbers.
  - x, an identifier or expression.
- boxcar(a,b,x) returns θ(x−a)−θ(x−b), where θ is the Heaviside function (see Section 7.3.9). The resulting expression defines a function which is zero everywhere except within the segment [a,b], where its value is equal to 1.

#### Examples

boxcar(1,2,x)

θ | ⎛ ⎝ | x−1 | ⎞ ⎠ | −θ | ⎛ ⎝ | x−2 | ⎞ ⎠

boxcar(1,2,3/2)

1 |  |  |  |  |  |  |  |  |  |

boxcar(1,2,0)

0 |  |  |  |  |  |  |  |  |  |