Troubles with Matlab&Simulink input time format
Ältere Kommentare anzeigen
Hi I have a time in format 123456.78 where 12 is hour, 34 minutes , 56 secounds and i need to get (12:34:56.78). I have tried to add ':' after every pair, but it didn't work. When i use datestr funcion, it give me back bad answer because datestr is working with day that means 1.5 = 12:00 can you help me please.
Akzeptierte Antwort
Weitere Antworten (1)
Easwar Kumar Yarrabikki
am 24 Feb. 2017
Bearbeitet: Easwar Kumar Yarrabikki
am 24 Feb. 2017
Hello This is how I deal with date and time in MATLAB,
Hope it will help you. it will give you date and time of that particular run.
you can change "_" to any symbol you want use, Either ":" or Some thing else .
format = 'yyyy_mm_dd_HH_MM_SS';
date_time = datestr(now, format)
1 Kommentar
Bozhidar Stoyanov
am 24 Feb. 2017
Bearbeitet: Bozhidar Stoyanov
am 24 Feb. 2017
Kategorien
Mehr zu Language Fundamentals finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!