Problem with formatting time
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
I have a column of times in the format:
HH:MM:SS.FFF
(so seconds are to 3 decimal places). I'm trying to import this column but I can't find a way to format it properly. I've tried custom formatting, namely:
HH:MM:SSSSSS HH:MM:SSSSS HH:MM:SS.SSS
but am being returned "NaN", and:
HH:MM:SS.FFF
but I'm getting an exponential number instead. I'd really like to get it in the hour-min-sec format. What should I do?
0 个评论
回答(1 个)
Please post exactly what you do: What is the input source? A file, a cell string, a string? With which function or tool do you want to import the values?
The "exponential number" you get is the serial date format. You can simply convert it by datevec or datestr depending on what "hour-min-sec format" exactly mean.
It might be cheaper to treat the date string as a string and import it as numerical values directly by:
%d:%d:%f
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!