📄 deg2dms.m
字号:
function [d,m,s]=deg2dms(deg)
%DEG2DMS Convert degrees into dms format.
% This function converts from DEG degrees into
% D(deg)M'S".
%
% [D,M,S] = DEG2DMS(DEG) converts value DEG in unit degrees
% into D degrees, M arcminutes and S arcseconds.
%
% DMS = DEG2DMS(DEG) converts value DEG in unit degrees
% to a vector corresponding to the values [D M S] above.
%
% See also DMS2DEG, HMS2SEC, SEC2HMS, NUM2MASS.
% Copyright (c) 2002-03-05, B. Rasmus Anthin.
d=floor(deg);
m=floor(60*(deg-d));
s=(deg-d-m/60)*3600;
[d,m,s]=sec2hms(hms2sec(d,m,s));
if nargout<3
d(2)=m;
d(3)=s;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -