How do I change the directory my support packages get installed in?

78 visualizzazioni (ultimi 30 giorni)

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 6 Ott 2025
Modificato: MathWorks Support Team il 6 Ott 2025
When installing support packages, the root directory is set to a default location for your specific system. You can change the location if your application requires a custom directory for installation. You must have administration privileges and be able to write to this custom folder. In order to set the support package root and verify the change, follow this example:
    matlabshared.supportpkg.setSupportPackageRoot('C:\MATLAB\CustomSupportPackageRoot')
    matlabshared.supportpkg.getSupportPackageRoot()
    ans =
    C:\MATLAB\CustomSupportPackageRoot
    When setting the support package root, the command "savepath" is called to add the location to the MATLAB search path. To ensure the path is loaded correctly, start MATLAB, run the function/command "setSupportPackageRoot", and then restart MATLAB.
     
    Note: You must have administration privileges for the custom folder you specify. Additionally, changing directories will cause already installed support packages to be lost from MATLAB, and they'd have to be reinstalled in the new location.
     
    For Windows, the default root directory is :
    R2017a or Newer
    'C:\ProgramData\MATLAB\SupportPackages\R20XXy'
    If the default directory already exists and is not empty, the root directory becomes 'C:\MATLAB\SupportPackages\R20XXy_1'.
    For Linux, the default root directory is:
    '/home/$USER/Documents/MATLAB/SupportPackages/R20XXy'
    where R20XXy is your specific MATLAB release. If the computed default directory already exists and is not empty, it becomes '/home/$USER/Documents/MATLAB/SupportPackages/R20XXy_1'.
    For macOS, the default root directory is
    '/Users/$USER/Documents/MATLAB/SupportPackages/R20XXy'
    where R20XXy is your specific MATLAB release. If the default directory already exists and is not empty, it becomes '/Users/$USER/Documents/MATLAB/SupportPackages/R20XXy_1'.

    Più risposte (0)

    Categorie

    Scopri di più su Search Path in Help Center e File Exchange

    Tag

    Non è stata ancora inserito alcun tag.

    Community Treasure Hunt

    Find the treasures in MATLAB Central and discover how the community can help you!

    Start Hunting!

    Translated by