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 ?

Antworten (1)

Grzegorz Knor
Grzegorz Knor am 5 Okt. 2011

0 Stimmen

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

Kategorien

Mehr zu App Building finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 5 Okt. 2011

Community Treasure Hunt

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

Start Hunting!

Translated by