Saving all tabs into a folder
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
This question is about the interface. I would like to save all my Matlab script tabs into a folder. Is there any quick way to do that? Unfortunately, I cannot save them one by one since I do have 100+ scripts.
Thanks.
4 Commenti
Rik
il 22 Apr 2023
Are you using the words script and function interchangeably? Because 100+ scripts is very likely to be a sign of terrible design. You should use functions to make sure you have a stable interface that you can document and can improve in isolation.
Risposta accettata
Walter Roberson
il 22 Apr 2023
targetdir = 'DirectoryToSaveInto';
if ~isdir(targetdir); mkdir(targetdir); end
X = matlab.desktop.editor.getAll;
newnames = fullfile(targetdir, {X.Filename}.');
arrayfun(@(Info, NewName) Info.saveAS(NewName), X, newnames)
You might need to 'Uniform', 0. You might possibly need to loop. And you might possibly need to deal specially with untitled
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Adding custom doc in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!