plus.m
来自「There are numerous MATLAB m-files includ」· M 代码 · 共 12 行
M
12 行
function r = plus(a,b)
if isa(a, 'DateTime') & isa(b, 'double')
pom = a.wsec + b;
r = DateTime(a.gweek, pom);
elseif isa(b, 'DateTime') & isa(a, 'double')
pom = a + b.wsec;
r = DateTime(b.gweek, pom);
else
err = sprintf('Operator plus in DateTime does not allow arguments %s %s', class(a), class(b));
error(err);
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?