ss="comment">% sample a new x0</span>
       x0 = randn(n,1);         <span class="comment">% Gaussian x</span>
       <span class="comment">%x0 = 3*(2*rand(n,1)-1);  % Uniform x</span>
       <span class="comment">%x0 = sign(randn(n,1));   % Binary x</span>

       <span class="comment">% true x0 is k0-sparse  (recovered x will be k-sparse)</span>
       idx = randperm(n);
       x0(idx(1:n-k0)) = 0;

       trueWeights(:,c) = x0;

       <span class="comment">% resulting y for linear model</span>
       <