Skip to content

Commit

Permalink
Update smallCS.m
Browse files Browse the repository at this point in the history
  • Loading branch information
moon by the stars authored Jul 17, 2018
1 parent d0d43f2 commit 54d4f49
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions toy_example/smallCS.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@

%{
input:pool:The number of pools.
p:Determine the proportion of 1 in the M matrix.
output:recoverXX:inference X.
%}

function smallCS(pool,p)
pool = str2num(pool)

p = str2num(p)

original = importdata('pan_expression.txt');
X = [original.data];

Expand All @@ -11,12 +18,11 @@ function smallCS(pool,p)
recoverX = [];
for i = 1:size(X,2)
y = M*X(:,i);
x0 = M'*y;
[w, hcond] = linsolve(M*M',y);
x0 = M'*w;
xp = l1eq_pd(x0, M, [], y);
recoverX = [recoverX xp];
end

fname = ['pool_',num2str(pool),'_p_',num2str(p),'.mat'];
%save fname -ascii recoverX
save(fname,'recoverX','M','-mat');

0 comments on commit 54d4f49

Please sign in to comment.