I have this code on an exit button and when I hit the button and select 'yes' to save the data I receive the figure again. Why? What am i doing wrong? And why when I select 'no', I receive the questiondlg again?
answer=questdlg('Save changes to the model?',... 'Exit ADADCS Confirm','Yes','No','Cancel','Cancel'); switch answer case 'Yes' [filename,pathname] = uiputfile('default','Save your GUI settings');if pathname == 0 %if the user pressed cancelled, then we exit this callback
returnend%construct the path name of the save location
saveDataName = fullfile(pathname,filename); %saves the gui data
hgsave(saveDataName); delete(hObject);% Hint: delete(hObject) closes the figure
close all; case 'No' delete(hObject);% Hint: delete(hObject) closes the figure close all; end
Best Answer