MATLAB: How to get the name of the mat file saved from the uisave function

dataguiloadsave

I am going to write a GUI based program. The workspace data-set needs to be saved as a Project file. In fact, I want to design some buttons named 'Save' , 'Save as' and 'Load'. Anyone can help me to write its code suitably?. I need to know the name and address of the file that has been saved from uisave function.

Best Answer

Do not use uisave but:
[filename, filepath] = uiputfile('*.mat', 'Save the project file:')
if isequal(filename,0) || isequal(pathname,0)
disp('User pressed cancel')
return;
end
FileName = fullfile(pathname, filename);
save(FileName, 'YourData');