stdepoch.m

来自「航天工程工具箱」· M 代码 · 共 24 行

M
24
字号
function epoch=stdepoch(N,type)
%STDEPOCH  Sets standard epoch in YMDhms format.
%   EPOCH = STDEPOCH([N[,TYPE]]) is the standard epoch
%   of either type AD, J2000 or B1950. If omitted then
%   DATE defaults to current date. N is the number of
%   satellites (defaults to N=1).
%
%   See also CLOCK.

% Copyright (c) 2003-06-09, B. Rasmus Anthin.

if ~nargin, N=1;end
if nargin<2, type='';end
switch(upper(type))
case 'AD'
   date=zeros(1,6);
case 'J2000'
   date=[2000 1 1, 12 0 0];
case 'B1950'
   date=[1949 12 31, 22 9 7.2];
otherwise
   date=clock;
end
epoch=repmat(date,N,1);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?