Hi all, i ran the code as below and i got some errors as stated, can someone tell me what is the error or anything that i should do to make this coding run?
%% Find sparse coefficients using BP coeffMat = zeros(numTrain, numTest); % there are numTest numTrain-dimensional coefficients tic; cvx_clear; for testIdx = 1:numTest if rank(dictionary) == size(dictionary,1) cvx_begin cvx_quiet(true); variable coeff(numTrain) minimize(norm(coeff, 1)); subject to dictionary'*coeff==testStruct.testMat(testIdx,:)'; cvx_end else coeff = zeros(numTrain); end disp(testIdx/numTest); % Uncomment for a faster but less accurate implementation of BP % [coeff, iterationCount] = ... % SolveDALM_fast(dictionary', testStruct.testMat(testIdx,:)'); coeffMat(:, testIdx) = coeff; % save coefficients end toc;
Error using cvxprob/newcnstr (line 87)
Matrix dimensions must agree.
Error in == (line 12)
b = newcnstr( evalin( ‘caller’, ‘cvx_problem’, ‘’ ), x, y, ‘==’ );
Error in testsparseclassify (line 58)