How Can I Use MATLAB to Solve a Total Variation Denoising / Deblurring Problem?

The Total Variation Denoising Problem is given by:

$$\arg \min_{x} \frac{1}{2} {\left\| A x - y \right\|}_{2}^{2} + \lambda \operatorname{TV} \left( x \right)$$

Where $$\operatorname{TV} \left( \cdot \right)$$ is the Total Variation Norm.

How could one solve this using MATLAB?

I will solve this for 1D but it could easily generalize into 2D.

The nice thing about the TV Norm that it can be re formulated by the $${L}_{1}$$ norm of the Derivative Operator:

$$\operatorname{TV} \left( x \right) = \sum_{i = 1}^{N - 1} \left| {x}_{i + 1} - {x}_{i} \right| = {\left\| D x \right\|}_{1}$$

Where $$D$$ is the matrix form of the Derivative Operator.
So the whole problem can be formulated as:

$$\arg \min_{x} \frac{1}{2} {\left\| A x - y \right\|}_{2}^{2} + \lambda \operatorname{TV} \left( x \right) = \arg \min_{x} \frac{1}{2} {\left\| A x - y \right\|}_{2}^{2} + \lambda {\left\| D x \right\|}_{1}$$

For the above there are many solvers based on ADMM or Proximal Gradient Descent.
You could even use the Sub Gradient Method to solve the above as the Sub Gradient is given by:

$${A}^{T} \left( A x - y \right) + {D}^{T} \operatorname{sign} \left( D x \right)$$