Save and load alternative sets of preferences
Afficher commentaires plus anciens
I know how to set Preferences in Matlab through GUI buttons,
however, suppose I have different sets of preferences that I would like to switch back and forth between. Is there a way to save a given set of preferences to a file and reload it later?
2 commentaires
dpb
le 20 Nov 2020
I've never tried messsing with stuff programmatically, either, but check out https://www.mathworks.com/help/matlab/ref/settings.html
It looks as though one could build some tools to do something like you're thinking. AFAICT, however, there isn't any prebuilt feature as one would think could be to just swap sets.
Star Strider
le 20 Nov 2020
Executing:
prefdir
in a script or Command Window will show the directory to the preferences that you can then bring up (with File Explorer in Windows recent releases) that you can then manually save to a different directory of your choice. Jan Simon posted a Question (with solution) in that respect several years ago, however that solution no longer works (when I tried it) in more recent releases.
Re-creating these by copying the contents of that ‘back-up’ directory back to the prefdir directory doesn’t always work either, as I unfortunately discovered after (yet another too frequent) recent Windows crash. As dpb notes, I doubt that you could do that programmatically.
It might be (I hope would be) worthwhile to contact MathWorks and submit this as an enhancement request. I (for one) would certainly want that ability, even if only to securely restore existing preferences after a crash.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Desktop dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!