fclose() - How do I close all open files but one?
19 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I'd like to close all my open files but one, is there a simple way to do it? Simpler than deleting them one by one?
It's possible for variables with:
clearvars -except variable_needed
But unsurprisingly the following does not work:
fclose all -except fileID
Thanks,
0 Commenti
Risposte (2)
Tony Mohan Varghese
il 1 Dic 2017
Currently, there is no way to close all open files, except one.
0 Commenti
Walter Roberson
il 1 Dic 2017
There is no direct way. You can
arrayfun(@fclose, setdiff(fopen('all'), fileID));
provided the fileID is given as numeric.
0 Commenti
Vedere anche
Categorie
Scopri di più su Workspace Variables and MAT-Files 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!