programming for the pathname

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 日

0 投票

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

カテゴリ

ヘルプ センター および File ExchangeApp Building についてさらに検索

タグ

質問済み:

2011 年 10 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by