필터 지우기
필터 지우기

How to create file names in certain format?

조회 수: 9 (최근 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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 String에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by