initial commit of Gregorian/IFC date conversion tools and unit tests

This commit is contained in:
2025-02-16 21:12:54 -08:00
parent 08f09ce109
commit 95985ef032
8 changed files with 339 additions and 0 deletions

30
isLeap.m Normal file
View File

@@ -0,0 +1,30 @@
function flag = isLeap(Year)
arguments (Input)
Year (:, 1) uint16
end
arguments (Output)
flag (:, 1) logical
end
% flag = NaN(size(Year));
isDivisibleBy4 = ~mod(Year, 4);
isNotDivisibleBy100 = logical(mod(Year, 100));
isDivisibleBy400 = ~mod(Year, 400);
flag = isDivisibleBy4 & (isDivisibleBy400 | isNotDivisibleBy100);
% if ~mod(Year, 4)
% if ~mod(Year, 100)
% if ~mod(Year, 400)
% flag = true;
% else
% flag = false;
% end
% else
% flag = true;
% end
% else
% flag = false;
% end
end