programming for the pathname

3 visualizzazioni (ultimi 30 giorni)
SSUET SSUET`
SSUET SSUET` il 5 Ott 2011
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 ?

Risposte (1)

Grzegorz Knor
Grzegorz Knor il 5 Ott 2011
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

Categorie

Scopri di più su App Building in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by