Hi Mark,

Thank you for your reply.

What I have done is I run the code for the minimization mentioned without the regularization term. That is:

minimize (norm((A_matrixA*x-b_vectorA),2)+norm((A_matrixD*x-b_vectorD),2))

The result, x(n), from CVX is what I use for the regularization term next time I run the optimization again.

Therefore, I use

v_delta=abs(diff(x,1))

I add this into the optimization to result as:

minimize (norm((A_matrixA*x-b_vectorA),2)+norm((A_matrixD*x-b_vectorD),2)+lambda*norm((v_delta),1))

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

minimize (norm((A_matrixAC*x-b_vectorAC),2)+norm((A_matrixAD*x-b_vectorAD),2))+(lambda*norm((diff(x)),1))

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?