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)?
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)
data5=importdata(uigetfile(‘*’));
dd=length(data5(:,1));
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)?
Cheers,
Eli
Eli, does this help?
Cheers
Bob
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)
data5=importdata(uigetfile(‘*’));
dd=length(data5(:,1));
and it just doesn’t work
@Andreas,
What file are you selecting?
If you uigetfile the name of the file directly does it work? What is the error message?