I am trying to solve the following problem here.

Given z_0,z_g \in \mathbb{R}^n

\textbf{minimize} \|z-z_g\|

\text{subject to} \quad 0 \leq \sum_{i=1}^k (z_{0,i}-z_i) \leq C \quad \forall k = 1,2,...,n

Where C is a constant scalar. There are other constraints too but this constraint is the one CVX is complaining about, despite how it solved the problem once before.

Can anybody help?

The complain reads:

```
The following error occurred converting
from cvx to double:
Error using double
Conversion to double from cvx is not
possible.
Error in myfun (line 39)
V(k) = dx*sum(z0(1:k)-z(1:k));
```