# How to write the constraint involving indicator functions in CVX?

How to write the following constraints involving indicator functions in CVX?

0 \leq \sum_{i=1}^{m} \omega_{i} \cdot \mathbb{1}_{\{x > D_{i}\}} \leq 1, \forall x \in R,

and

0 \leq \sum_{i=1}^{m} \omega_{i} \cdot \mathbb{1}_{\{ D_{i} < x \leq M_{i}\}} \leq 1, \forall x \in R

where, D and M are given, while \omega is the decision variable.