필터 지우기
필터 지우기

how to precise the number of digits in MATLAB?

조회 수: 1 (최근 30일)
ihssane houhou
ihssane houhou 2018년 12월 5일
댓글: ihssane houhou 2018년 12월 5일
hi guys
I want to save some images in a folder from matlab using imwrite(), and I want to name them by counting, which means each image will be named by two letters and six digits such as (gt000001, gt000002, gt000003, gt000004, ..., gt001457, ... ,gt200000).
could someone help me do that?

채택된 답변

Rik
Rik 2018년 12월 5일
You can generate a name like that with the sprintf function:
number=2;
name=sprintf('gt%06d',number);
  댓글 수: 2
madhan ravi
madhan ravi 2018년 12월 5일
+1 exactly!
ihssane houhou
ihssane houhou 2018년 12월 5일
thank you, it worked very well.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by