how to define a path in saveas command
46 views (last 30 days)
Image Analyst on 18 Jun 2020
You probably messed up by not having the slashes correct. You should use fullfile(), like this:
folder = 'E:\matlab';
% Folder does not exist. Ask the user to browse to an existing one.
uiwait(msgbox('Please select the output folder'))
folder = uigetdir(pwd);
if folder == 0
% User clicked cancel.
for k = 1 : whatever
% Some code to change the current figure...
% Now save the current figure.
baseFileName = sprintf('%03d.png', k);
fullFileName = fullfile(folder, baseFileName);