how to get the time long after decimal point
2 次查看(过去 30 天)
显示 更早的评论
format longg
t=clock;
t1 = t([5,6]);
this code output is min(21) sec(19.955) now i wish to get after decimal point more than 5 digit and both minute and second will be show. is it possible
0 个评论
回答(2 个)
Azzi Abdelmalek
2015-6-14
编辑:Azzi Abdelmalek
2015-6-14
it's format long, with one g
format long
t=clock;
t1 = t([5,6])
Jan
2015-6-14
The format command influences the output in the command window in general. When you want to modify a specific variable only, use sprintf or fprintf:
t = clock;
t1 = t(5:6);
fprintf('%.5f min %.5f sec\n', t1);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!