Hi all, here’s my problem:

Error using +: Matrix dimensions must agree.

Error using cov: xc = x - sum(x,1)./m; % Remove mean

i’m trying to compute the mahalanobis distance.

My objective function is :

x=arg min||x||_1+||Ax-y||_M ,which is equal to：

x=arg min||x||_1+||L(Ax-y)||_2, where S is the covariance matrix of Ax and y, and inv(S)=L* L.

A is a m *n matrix, x is n *1 vector, y is n *1 vector.

here’s my matlab code:

cvx_begin quiet

[~,c_n] = size(tt_dat(:,ci));

variable x(alltr_num);

minimize(norm(x,1));

%%%%%%%%%%%%%%%%%%%%%%%%

subject to

norm(chol(inv(cov1([(tr_dat * x)’;tt_dat(:,ci)’])+0.00001 * eye(c_n,c_n))) * (tr_dat * x-tt_dat(:,ci)),2)<=N;

cvx_end

Can anyone help me?