hms2sec.m

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

M
18
字号
function x=hms2sec(h,m,s)
%HMS2SEC  Convert hms format into seconds.
%   SEC = HMS2SEC(H,M,S) converts value H in unit hours,
%   value M in unit minutes and S in unit seconds into
%   SEC in unit seconds.
%
%   SEC = HMS2SEC(HMS) converts vector HMS
%   corresponding to the values [H M S] above into
%   SEC in unit seconds.
%
%   See also SEC2HMS, DEG2DMS, DMS2DEG, NUM2MASS.

% Copyright (c) 2002-03-04, B. Rasmus Anthin.

if nargin==2,error('Must be 1 or 3 arguments.'),end
hms=h;
if nargin==3,hms=[h m s];end
x=hms*60.^(2:-1:0)';

⌨️ 快捷键说明

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