Open file explorer using matlab gui pushbutton -
i want create matlab gui can open file explorer using pushbutton , select file further processing. how can that?
also want know how assign .m function files pushbuttons. tried putting functionname.m file in callback of pushbutton. didn't work.
please me both doubts.
you'll need write callback function launch file selection dialog (uigetfile
)
set(hbutton, 'callback', @mycallback) function mycallback(src, evnt) [fname, pname] = uigetfile(); filepath = fullfile(pname, fname); % filepath end
in general if want call .m
file within callback, you'll want wrap call in anonymous function
set(hbutton, 'callback', @(src,evnt)functionname())
Comments
Post a Comment