Very often I tend to save the results of a file under the same name, but with a modified extension. This code shows how to achieve this
% change extension
[~, ~, ext] = fileparts(FileName);
FileName = strrep(FileName, ext, '-xyz.png');
If the file should be saved under a different folder it needs to be created and the file name changed accordingly
[filepath, filename, ext] = fileparts(FileName);
FileName = fullfile(filepath, 'results',  [filename, ext]);
fullpath = fullfile(filepath, 'results');
Where createDir is the following function
function createDir(pathstr)
if(~exist([pathstr], 'dir'))