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

78 ビュー (過去 30 日間)
How do I change the directory my support packages get installed in?

採用された回答

MathWorks Support Team
MathWorks Support Team 2025 年 10 月 6 日
編集済み: MathWorks Support Team 2025 年 10 月 6 日
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'.

    その他の回答 (0 件)

    カテゴリ

    Help Center および File ExchangeSearch Path についてさらに検索

    タグ

    タグが未入力です。

    Community Treasure Hunt

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

    Start Hunting!

    Translated by