Update Block RIP
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
function flg = can_recovery(Psi, s, eps)
|
||||
[m, n] = size(Psi);
|
||||
|
||||
x = zeros(n, 1);
|
||||
random_indices = randperm(n, s);
|
||||
x(random_indices) = randn(s, 1);
|
||||
x = sign(x);
|
||||
y = Psi * x;
|
||||
|
||||
cvx_begin
|
||||
variable s1(n)
|
||||
minimize(norm(s1, 1))
|
||||
subject to
|
||||
norm(y - Psi * s1) <= eps
|
||||
cvx_end
|
||||
|
||||
p = norm(x - s1, 2);
|
||||
|
||||
if p < eps
|
||||
flg = 1;
|
||||
else
|
||||
flg = 0;
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user