現在時刻を使ったフォ​ルダを作るにはどうす​ればいいですか?

56 views (last 30 days)
MathWorks Support Team
MathWorks Support Team on 10 Sep 2019
現在時刻を使ったフォルダ名で新規フォルダを作成する方法を教えてください。

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 10 Sep 2019
datetime 関数を使って現在の日時を取得し、char 関数でテキストに変換します。
datetime 関数の Format プロパティにて出力テキストのフォーマットを指定します。
% フォルダ名の作成
>> fname = char(datetime('now','Format','yyyyMMdd'))
fname =
'20190910'
>> mkdir(fname) % フォルダの作成

More Answers (0)

Categories

Find more on MATLAB 入門 in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!