フィルターのクリア

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 Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by