Thank you for your reply.
What I have done is I run the code for the minimization mentioned without the regularization term. That is:
The result, x(n), from CVX is what I use for the regularization term next time I run the optimization again.
Therefore, I use
I add this into the optimization to result as:
Yet the result/graph of x the second time around is the same as the first one. When changing lambda, the optimal value does increase but the result of x is still the same.
I tried to do
But I get the error that Undefined function ‘diff’ for input arguments of type ‘cvx’.
Another this is when running, it uses SDPT3 is solving the dual problem.
Am I incorporating the regularization term wrongfully?