How do I change the directory my support packages get installed in?
78 views (last 30 days)
Show older comments
MathWorks Support Team
on 15 Jan 2018
Edited: MathWorks Support Team
on 6 Oct 2025
How do I change the directory my support packages get installed in?
Accepted Answer
MathWorks Support Team
on 6 Oct 2025
Edited: MathWorks Support Team
on 6 Oct 2025 at 21:17
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 Comments
More Answers (0)
See Also
Categories
Find more on Search Path in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!