Set Add-ons path using commands
Ältere Kommentare anzeigen
Hi,
I'm interested in setting the Add-ons path using commands rather than going through the MATLAB preferences dialog. Is there a way to do this?
Thanks
Alan
Antworten (1)
Henry Giddens
am 30 Sep. 2017
1 Stimme
6 Kommentare
aL
am 4 Okt. 2017
Henry Giddens
am 30 Okt. 2017
Oh sorry, I completely misread the question. I wonder if you've figured it out yet? Does this help?
https://undocumentedmatlab.com/blog/changing-system-preferences-programmatically
aL
am 30 Okt. 2017
John Harris
am 27 Dez. 2017
Bearbeitet: John Harris
am 12 Sep. 2018
Thanks for that, aL! I was only needing to get the current value but running into the same problem. You saved me a lot of time!
For the S/s issue with settings, could you try out this command?
matlab.internal.getSettingsRoot
To clarify, for 2017b:
rootSettings = matlab.internal.getSettingsRoot
folder = rootSettings.matlab.addons.InstallationFolder.ActiveValue
returns these
rootSettings =
SettingsGroup with properties:
connector: [1×1 SettingsGroup]
Simulink: [1×1 SettingsGroup]
installedAddons: [1×1 SettingsGroup]
slhistory: [1×1 SettingsGroup]
folder =
'C:\Users\harrisj2\Documents\MATLAB\Add-Ons'
I don't have better solution for the change from 'AppsInstallFolder' to 'InstallationFolder' that you detected at R2016; the try/catch works well for that.
John Harris
am 4 Jan. 2018
One place the add-ons directory is stored, at least on Windows, is a matlab.settings file in the AppData folder. For example, mine is c:\users\username\AppData\Roaming\MathWorks\MATLAB\R2017b\matlab.settings with a key name of "InstallationFolder".
James Richard
am 20 Mär. 2022
Bearbeitet: James Richard
am 20 Mär. 2022
So what's the solution to change the add-ons directory directly?
We have this to change the hardware support package directory.
matlabshared.supportpkg.setSupportPackageRoot
But why don't we have something like this?
matlab.internal.setSettingsRoot
Kategorien
Mehr zu System Commands finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!