Add "FAR vs PD"
This commit is contained in:
Executable
+13
@@ -0,0 +1,13 @@
|
||||
function [indices, z] = get_sparse_vector(N, Amp)
|
||||
global K extend_target;
|
||||
z = zeros(N, 1);
|
||||
if extend_target
|
||||
target_start_idx = fix(0.4 * N);
|
||||
target_size = K;
|
||||
indices = target_start_idx: target_start_idx + target_size;
|
||||
else
|
||||
indices = randperm(N, K);
|
||||
end
|
||||
z(indices) = Amp;
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user