function [v X] = STATESON(Y,A,C,G,R,Q,w,lambda,p)
N=length(Y);
n=size(C,2);
cvx_begin
  variables X(n,N) v(1,N-1)
  minimize( sum((inv(sqrtm(R))*(Y-C*X)).^2)+lambda*norms(inv(sqrtm(Q))*diag(w)*v',p,1))
  subject to
  X(:,2:end) == A*[X(:,1:end-1)]+G*v
  X(:,1) == 0
cvx_end
