Path: news.mathworks.com!not-for-mail
From: "BC Tan" <rainzz@live.com>
Newsgroups: comp.soft-sys.matlab
Subject: how to show filename in GUI
Date: Sun, 30 Aug 2009 10:02:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <h7dimp$pol$1@fred.mathworks.com>
References: <h7be53$kjl$1@fred.mathworks.com> <h7berj$atl$1@fred.mathworks.com> <h7bg8j$afj$1@fred.mathworks.com> <h7bh2r$3ig$1@fred.mathworks.com> <h7binq$hq4$1@fred.mathworks.com>
Reply-To: "BC Tan" <rainzz@live.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1251626521 26389 172.30.248.37 (30 Aug 2009 10:02:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 30 Aug 2009 10:02:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1943074
Xref: news.mathworks.com comp.soft-sys.matlab:567055


Hi All,

I have the following code to read in the filename of the music file.

[filename, pathname] = uigetfile('*.*', 'Pick any file');
[y, fs, nbits] = wavread(filename);
handles.value = filename;

I had created a GUI and had placed a static text with tag being "tSource".
I would like to show the filename of the file that the users had chosen in the GUI with the following code.

set(handles.tSource,'String',sprintf('%s:%d',handles.value,handles.id));

However, the code is unable to show the filename as predicted. can anyone tell me what is wrong with my code?

Tks a million!