現在時刻を使ったフォルダを作るにはどうすればいいですか?
56 views (last 30 days)
Show older comments
MathWorks Support Team
on 10 Sep 2019
Answered: MathWorks Support Team
on 10 Sep 2019
現在時刻を使ったフォルダ名で新規フォルダを作成する方法を教えてください。
Accepted Answer
MathWorks Support Team
on 10 Sep 2019
datetime 関数を使って現在の日時を取得し、char 関数でテキストに変換します。
datetime 関数の Format プロパティにて出力テキストのフォーマットを指定します。
% フォルダ名の作成
>> fname = char(datetime('now','Format','yyyyMMdd'))
fname =
'20190910'
>> mkdir(fname) % フォルダの作成
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!