function A=rbf1(A,style,param) % function A=rbf1(A,style,param) % param is optional for certain nonlinearities (See below) % % This function applies the nonlinearity in "style" to the matrix A: % style=1: Gaussian. Param needed for width: Default is 1 % 2: Cubic % 3: Thin Plate Spline % 4: Cauchy % 5: Multiquadric. Param needed for centering. Default is 1 % 6: Inverse Multiquadric. Param needed, default is 1. switch style case 1 if nargin<=2 sigma=1; else sigma=param; end A=exp(-(A.^2)./(param.^2)); case 2 A=A.^3; case 3 Gidx=find(A(:)==0); if length(Gidx)>0 error('The EDM in RBF1 cannot have zeros in the Thin Plate Spline'); else A=(A.^2).*log(A); end case 4 A=1./(1+A); case 5 if nargin<=2 beta=1; else beta=param; end A=sqrt(A.^2+beta); case 6 if nargin<=2 beta=1; else beta=param; end A=1./(sqrt(A.^2+beta)); end