复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28% 函数功能:将秒转化为小时,分钟,秒 % 例如:'08:20:00' = second_change(30000) function Output = second_change(num) hour = floor(num/3600); % floor: 向下取整 minute = floor(mod(num,3600)/60); % mod: 求余数 second = num - 3600*hour - 60*minute; if hour < 10 hour = ['0',mat2str(hour)]; % mat2str:将double转化为字符串 else hour = mat2str(hour); end if minute < 10 minute = ['0',mat2str(minute)]; else minute = mat2str(minute); end if second < 10 second = ['0',mat2str(second)]; else second = mat2str(second); end Output = [hour,':',minute,':',second]; end
最后
以上就是霸气蜻蜓最近收集整理的关于matlab 将秒转化为小时,分钟,秒的全部内容,更多相关matlab内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复