How to get the file name as the title of the figure window?

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.

 Respuesta aceptada

per isakson
per isakson el 22 de En. de 2015
Editada: per isakson el 22 de En. de 2015
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 comentarios

dpb
dpb el 22 de En. de 2015
Good catch, missed the '%d'
Thanks guys...

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Graphics Object Properties en Centro de ayuda y File Exchange.

Preguntada:

el 22 de En. de 2015

Comentada:

el 22 de En. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by