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

79 vues (au cours des 30 derniers jours)
How do I change the directory my support packages get installed in?

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 6 Oct 2025
Modifié(e) : MathWorks Support Team le 6 Oct 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'.

    Plus de réponses (0)

    Catégories

    En savoir plus sur Search Path dans Help Center et File Exchange

    Tags

    Aucun tag saisi pour le moment.

    Community Treasure Hunt

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

    Start Hunting!

    Translated by