This is one in a series of videos covering MATLAB basics. It is meant for the new MATLAB user.
This video covers how to use UIGETFILE to make it easier to select a file from a script, function or GUI.
Other videos have been gathered here:
Other MATLAB Basics posts have been gathered here:
Comments are closed.
4 CommentsOldest to Newest
Say I use uigetfile to get a filename that is in a path not currently part of the matlab path. When I execute the next line of code (load(fileName)), the file will not be loaded since it is not in the current path. How can I go about adding the path (automatically/ without additional user input)?
Eli, does this help?
[f,p] = uigetfile; load(fullfile(p,f))
i’m having a problem when using uigetfile in a gui i developed…i have created a pushbutton and in it i have writen:
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
and it just doesn’t work
What file are you selecting?
If you uigetfile the name of the file directly does it work? What is the error message?