hi,
I have the GUI and I want to get the name of the selected file as the title of the figure window.
[baseFileName,folder]=uigetfile('*'); % read the input image
-
-
-
figure('name',sprintf('file name is %d',baseFileName),'NumberTitle','off');
I tries in this way, but couldn't get the result.
Can any one help me.
Thanks in advance.

 採用された回答

per isakson
per isakson 2015 年 1 月 22 日
編集済み: per isakson 2015 年 1 月 22 日

2 投票

Try to replace
sprintf('file name is %d',baseFileName)
by
sprintf('file name is %s',baseFileName)
Since the value of baseFileName is a character string, %s is the appropriate format specifier.

2 件のコメント

dpb
dpb 2015 年 1 月 22 日
Good catch, missed the '%d'
Manoj Kumar
Manoj Kumar 2015 年 1 月 22 日
Thanks guys...

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Graphics Object Properties についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by