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

78 visualizaciones (últimos 30 días)
How do I change the directory my support packages get installed in?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 6 de Oct. de 2025
Editada: MathWorks Support Team el 6 de Oct. de 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'.

    Más respuestas (0)

    Categorías

    Más información sobre Search Path en Help Center y File Exchange.

    Etiquetas

    Aún no se han introducido etiquetas.

    Community Treasure Hunt

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

    Start Hunting!

    Translated by