フィルターのクリア

How to make filename that message + date&time using [imwrite function].

4 ビュー (過去 30 日間)
Junwon Park
Junwon Park 2018 年 6 月 5 日
編集済み: Stephen23 2018 年 6 月 5 日
The MATLAB code is {imwrite(red, datestr(now,'yyyy-mm-dd HH-MM-SS-FFF'),'png');}
I want to make file name "test_yyyy-mm-dd HH-MM-SS-FFF".png
Please, Let me know the method.
Thanks.

採用された回答

Kodavati Mahendra
Kodavati Mahendra 2018 年 6 月 5 日
編集済み: Kodavati Mahendra 2018 年 6 月 5 日
filename = strcat(datestr(now,'yyyy-mm-dd HH-MM-SS-FFF'),'.png');
imwrite(red, filename);
Solved? Problem was with the syntax for imwrite :-)
Edit 1:
filename = strcat('Test_',datestr(now,'yyyy-mm-dd HH-MM-SS-FFF'),'.png');
imwrite(red, filename);
Now?
  3 件のコメント
Kodavati Mahendra
Kodavati Mahendra 2018 年 6 月 5 日
You can just add your message string to the strcat function
Stephen23
Stephen23 2018 年 6 月 5 日
編集済み: Stephen23 2018 年 6 月 5 日
@Junwon Park: using sprintf is often clearer than concatenating strings:
filename = sprintf('Test_%s.png',datestr(now,'yyyy-mm-dd HH-MM-SS-FFF'));

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

その他の回答 (1 件)

Junwon Park
Junwon Park 2018 年 6 月 5 日
Thank you so much. It's solved. :)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by