⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sec2hms.m

📁 航天工程工具箱
💻 M
字号:
function [h,m,s]=sec2hms(x)
%SEC2HMS  Convert seconds into hms format.
%   [H,M,S] = SEC2HMS(SEC) converts value SEC in unit seconds
%   into hours H, minutes M and seconds S.
%
%   HMS = SEC2HMS(SEC) converts value SEC in unit seconds
%   to a vector corresponding to the values [H M S] above.
%
%   See also HMS2SEC, DMS2DEG, DEG2DMS, NUM2MASS.

% Copyright (c) 2002-02-09, B. Rasmus Anthin.

h=floor(x/3600);
rest=x-3600*h;
m=floor(rest/60);
s=rest-60*m;
if nargout<3
   h(2)=m;
   h(3)=s;
end

⌨️ 快捷键说明

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