フィルターのクリア

How to create file names in certain format?

4 ビュー (過去 30 日間)
Kelly Howard
Kelly Howard 2016 年 1 月 9 日
コメント済み: Kelly Howard 2016 年 1 月 9 日
hi guys, i would like to ask for example there are 49 files, i would like to name the file in certain format such as 001, 002 to 049. keep it in 3 digit long?

採用された回答

Stephen23
Stephen23 2016 年 1 月 9 日
You can use sprintf and specify the required length and leading zeros:
for k = 1:49
name = sprintf('myfile_%03d.txt',k)
end
  1 件のコメント
Kelly Howard
Kelly Howard 2016 年 1 月 9 日
THANK YOU!!!!!!!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT-Files についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by