www.pudn.com > 666bandelets_toolbox.zip > keep_above.m


function [y,m] = keep_above(x,T) 
 
% keep_above - keep only the coefficients above threshold T,  
%   set the rest to zero. 
% 
% y = keep_above(x,T); 
% 
%   Copyright (c) 2004 Gabriel Peyré 
 
if ~iscell(x) 
    % images or vectors 
    I = find(abs(x)=T ); 
elseif iscell(x) 
    % cell array 
    for i=1:length(x) 
        [y{i},m{i}] = keep_above(x{i},T);     
    end 
end