ivan@154: function x= thresh(x, K) ivan@154: ivan@154: [~, ind] = sort(abs(x), 'descend'); ivan@154: x(ind(K+1:end))= 0;