programming for the pathname

3 次查看(过去 30 天)
SSUET SSUET`
SSUET SSUET` 2011-10-5
When I press a push button followed by uigetfile .. after selecting the file .. i need to show the file path in the static Text box .. how can i do this ?

回答(1 个)

Grzegorz Knor
Grzegorz Knor 2011-10-5
function test
uicontrol('Style','pushbutton','String','get file','callback',@fclbck)
h = uicontrol('Style','text','String','...','Units','normalized',...
'Position',[.1 .4 .8 .2]);
function fclbck(src,evnt)
[filename, pathname] = uigetfile( ...
{'*.m';'*.mdl';'*.mat';'*.*'}, ...
'Pick a file');
set(h,'String',pathname)
end
end

类别

Help CenterFile Exchange 中查找有关 App Building 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by