Skip to content

Instantly share code, notes, and snippets.

@mykappa
mykappa / backupOpenEditorFilesList.m
Created August 25, 2021 11:25
Save a list of MATLAB scripts and functions open in the editor in case MATLAB crahes (for people like me who always work with way too many tabs)
%% Save list of files opened in MATLAB editor
% Get a list of open files
x = matlab.desktop.editor.getAll;
editor_open_files_list = {};
for ii = 1:size(x,2)
editor_open_files_list=[editor_open_files_list; {x(1,ii).Filename} {x(1,ii).Text}]; %#ok<AGROW>
end
% Define backup path