?? gpslsec.m
字號:
% gpslsec.m
% Scope: This MATLAB macros determines the UTC leap seconds value for a
% specified year between 1980 and 2059; after the year 1999 the leap
% second value is only an estimate.
% Usage: xoutput = gpslsec(year)
% Description of parameters:
% year - input, year (between 1980 and 2059)
% xoutput - output, UTC leap seconds value
% the result is set to -1 for out of range inputs
% Last update: 04/16/00
% Copyright (C) 1999-00 by LL Consulting. All Rights Reserved.
function xoutput = gpslsec(year)
if (year < 1980)
disp('Error 1 - GPSLSEC; year is not in range (year < 1980)');
xoutput = - 1;
elseif (year >= 1980.) & (year < 1981.5)
xoutput = 0;
elseif (year >= 1981.5) & (year < 1982.5)
xoutput = 1;
elseif (year >= 1982.5) & (year < 1983.5)
xoutput = 2;
elseif (year >= 1983.5) & (year < 1985.5)
xoutput = 3;
elseif (year >= 1985.5) & (year < 1988.)
xoutput = 4;
elseif (year >= 1988.) & (year < 1990.)
xoutput = 5;
elseif (year >= 1990.) & (year < 1991.)
xoutput = 6;
elseif (year >= 1991.) & (year < 1992.5)
xoutput = 7;
elseif (year >= 1992.5) & (year < 1993.5)
xoutput = 8;
elseif (year >= 1993.5) & (year < 1994.5)
xoutput = 9;
elseif (year == 1994.5) & (year < 1996.)
xoutput = 10;
elseif (year == 1996.) | (year < 1998.)
xoutput = 11;
elseif (year >= 1998) & (year < 1999.5)
xoutput = 12;
elseif (year >= 1999.5) & (year < 2001.)
xoutput = 13;
% estimated values (linear interpolation between values are recommended)
elseif (year >= 2001.) & (year <= 2059.)
xoutput = floor(14. + (22./29.)*(year - 2001.));
else
disp('Error 2 - GPSLSEC; year is not in range (year > 2059)');
xoutput = - 1;
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -