I did it by rewriting the code like this:
function nightly_simulation_Callback(hObject, eventdata, handles)
% hObject handle to nightly_simulation (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
PATH = 'C:\Users\xxx\Documents\Saved_Models';
files = dir( fullfile(PATH,'*.slx') ); %# list all *.slx files
fileNames = {files.name}';
fileNames=sort(fileNames);
nFiles=numel(fileNames);
selection = questdlg('Sure to start?',...
'Confirmation',...
'Yes','No','Yes');
switch selection
case 'Yes'
for i=1:nFiles
x = fullfile(PATH, fileNames{i});
open_system(x);
sim(x);
end
case 'No'
return
end