www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/RoundclockOutputtoIntegerDisplayExample.m

    %% Round clock Output to Integer Display  

% Copyright 2015 The MathWorks, Inc.


%% 
% Use |clock| to return the current date and time. 
format shortg
c = clock 

%%
% The sixth element of the date vector output (seconds) is accurate to several
% digits beyond the decimal point.  

%% 
% Use the |fix| function to round to integer display format. 
fix(c)