A
download isnear.m
Language: Matlab
LOC: 12
Project Info
copula - Bayesian Copula Selection(copula)
Server: Google
Type: svn
Google\c\copula\trunk\
   alphaboundaries.m
   analytic.mws
   bcs.m
   check_alpha.m
   check_tau.m
   conditionalcdf.m
   constrain_tau.m
   copulacdf.m
   copulaparam.m
   copulapdf.m
   copularnd.m
   copulastat.m
   dilog.m
   isnear.m
   kendall.m
   lambdaarch.m
   posterior.m
   quadg.m
   tauboundaries.m
   taujacobian.m

function tf=isnear(a,b,tol)
%ISNEAR True Where Nearly Equal.
% ISNEAR(A,B) returns a logical array the same size as A and B that is True
% where A and B are almost equal to each other and False where they are not.
% A and B must be the same size or one can be a scalar.
% ISNEAR(A,B,TOL) uses the tolerance TOL to determine nearness. In this
% case, TOL can be a scalar or an array the same size as A and B.
%
% When TOL is not provided, TOL = SQRT(eps).
%
% Use this function instead of A==B when A and B contain noninteger values.

% D.C. Hanselman, University of Maine, Orono, ME 04469
% Mastering MATLAB 7
% 2005-03-09

%--------------------------------------------------------------------------
if nargin==2
   tol=sqrt(eps);
end
if ~isnumeric(a) || isempty(a) || ~isnumeric(b) || isempty(b) ||...
   ~isnumeric(tol) || isempty(tol)
   error('Inputs Must be Numeric.')
end
if any(size(a)~=size(b)) && numel(a)>1 && numel(b)>1
   error('A and B Must be the Same Size or Either can be a Scalar.')
end
tf=abs((a-b))<=abs(tol);

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us