isnearinteger.m
来自「实现地震勘探中」· M 代码 · 共 23 行
M
23 行
function bool=isnearinteger(x,tol)% Function checks if x is approximately integer (with tolerance "tol")%% Written by: E. R.: November 10, 2005% Last updated:%% bool=isnearinteger(x,tol)% INPUT% x variable to check% tol maximum deviation from integer; % default 0% OUTPUT% bool logical variable (1 if abs(x-round(x)) <= tol, % 0 otherwise)if nargin == 1 bool=mod(x,1) == 0;else bool=abs(x-round(x)) <= tol;end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?