필터 지우기
필터 지우기

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

조회 수: 15 (최근 30일)
Manoj Kumar
Manoj Kumar 2015년 1월 22일
댓글: Manoj Kumar 2015년 1월 22일
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일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Identification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by