Skip to content

Instantly share code, notes, and snippets.

@1ncend1ary
Created April 25, 2021 12:32
Show Gist options
  • Save 1ncend1ary/c3a61d32c1fcbcf1007048e95601106f to your computer and use it in GitHub Desktop.
Save 1ncend1ary/c3a61d32c1fcbcf1007048e95601106f to your computer and use it in GitHub Desktop.
Matlab save all figures to folder
FolderName = tempdir; % Your destination folder
FigList = findobj(allchild(0), 'flat', 'Type', 'figure');
for iFig = 1:length(FigList)
FigHandle = FigList(iFig);
FigName = num2str(get(FigHandle, 'Number'));
set(0, 'CurrentFigure', FigHandle);
savefig(fullfile(FolderName, [FigName '.fig']));
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment