how to name a file with date and hour

3 次查看(过去 30 天)
jan
jan 2012-6-8
Hi i want to create a file in matlab which name is the date and the hour of the day thanks for help

回答(1 个)

Aurelien Queffurust
fid=fopen([ datestr(now,'dd_mm_yyyy_HH_MM_SS') '.txt'],'w')
will create a txt file as follows for 08-June-2012 14h11: 08_06_2012_14_11_12.txt

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by