フィルターのクリア

how to name a figure using a variable name

8 ビュー (過去 30 日間)
Johannes Deelstra
Johannes Deelstra 2016 年 5 月 14 日
コメント済み: Image Analyst 2016 年 5 月 23 日
I have a figure and want to save this as a tiff or jpeg I have changed a date into variable = 'van190392 15' which I want to use in the file name Such that I get as filename;van190392 15.tiff or van190392 15.jpeg I get an error message, it seems not being allowed/possible
  1 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 5 月 14 日
What is not working?

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

採用された回答

the cyclist
the cyclist 2016 年 5 月 15 日
編集済み: the cyclist 2016 年 5 月 15 日
variable = 'van190392 15';
figure
plot(rand(3,4))
filename = [variable,'.tif'];
print('-dtiff',filename)
  2 件のコメント
the cyclist
the cyclist 2016 年 5 月 22 日
Moved Johannes comment from an "answer" to here. He wrote,
"Thanks for the help, functions great"
Image Analyst
Image Analyst 2016 年 5 月 23 日
A related note: To get a figure to have a name you want, instead of like "Figure 1", "Figure 2", etc., you can turn the 'NumberTitle' property 'Off' and set the 'name' property of the figure to a literal string or a string variable:
% Give a name to the title bar/figure.
set(gcf, 'Name', 'Demo by ImageAnalyst', 'NumberTitle', 'Off')

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by