www.pudn.com > shearlet.rar > bump.m, change:2010-01-01,size:686b


function f=bump(x,lb,ub) 
% function: 
%        bump 
% input: 
%        x: (lb,ub) 
%        [lb,ub]: the bound of interval 
% output: 
%        f: C(lb,up); 
% Subfunction: (none) 
%---------------------------------------- 
% Principle: x in [lb,ub] 
% Application: construct a bump funciton 
% Attention:  
% Example:  
% See also smooth 
%---------------------------------------- 
% Designer: --- 
% Date: 10-Sep-2009 
 
if nargin==1,lb=-1;ub=1;            % default interval 
elseif nargin==0 
    lb=-1;ub=1;x=linspace(lb,ub,100);      
end 
 
x=2*(x-lb)/(ub-lb)-1; 
L=length(x); 
f=zeros(1,L); 
for i=1:L 
    if lb<x(i)&&x(i)<ub 
        f(i)=exp(-1/(1-x(i)^2)); 
    end 
end