2018-07-23 08:17:51 +00:00
|
|
|
function judge = NearZero(near)
|
2018-07-23 21:47:50 +00:00
|
|
|
% *** BASIC HELPER FUNCTIONS ***
|
2018-07-23 08:17:51 +00:00
|
|
|
% Takes a scalar.
|
|
|
|
|
% Checks if the scalar is small enough to be neglected.
|
|
|
|
|
% Example Input:
|
2018-07-23 21:47:50 +00:00
|
|
|
%
|
|
|
|
|
% clear; clc;
|
|
|
|
|
% near = -1e-7;
|
|
|
|
|
% judge = NearZero(near)
|
|
|
|
|
%
|
2018-07-23 08:17:51 +00:00
|
|
|
% Output:
|
|
|
|
|
% judge =
|
|
|
|
|
% 1
|
|
|
|
|
|
|
|
|
|
judge = norm(near) < 1e-6;
|
|
|
|
|
end
|