Main Content

matlabshared.supportpkg.setSupportPackageRoot

Set root folder of support packages

Description

example

matlabshared.supportpkg.setSupportPackageRoot(installDir) sets the root folder of the current support packages. MATLAB® installs all support packages to this location.

You must have administrative privileges on the folder that you set the root to. You must also have administrative privileges to modify matlabroot, because the root folder of the support package is recorded under matlabroot.

When you change the root folder, support packages installed in the new location become available on the MATLAB path. Any previously installed support packages are removed from the MATLAB path, but the files are still available.

Examples

collapse all

Use the setSupportPackageRoot function to change the installation folder for support packages. You need administrative privileges to use this function.

matlabshared.supportpkg.setSupportPackageRoot('C:\MATLAB\CustomSupportPackageRoot')

Use getSupportPackageRoot to check that the change was successful.

matlabshared.supportpkg.getSupportPackageRoot
ans =

C:\MATLAB\CustomSupportPackageRoot

Input Arguments

collapse all

Root folder of support packages, specified as a character vector. The folder path cannot contain any spaces.

The default location of the root folder is platform specific:

  • Windows®C:\ProgramData\MATLAB\SupportPackages\release

  • Linux® and macOS/home/user/Documents/MATLAB/SupportPackages/release

release is the current MATLAB release and user is your Linux and macOS user name.

If a folder exists at the default location and is not empty, MATLAB sets the root folder location to the default location appended with _n. For example, on a Windows system running MATLAB R2021a, if the folder C:\ProgramData\MATLAB\SupportPackages\R2021a exists and is not empty, MATLAB sets the root folder to C:\ProgramData\MATLAB\SupportPackages\R2021a_1 by default.

Example: 'C:\MATLAB\SupportPackage\R2021a'

Data Types: char

Introduced in R2016a