MATLAB path

IDMCC-1
TitleAdapting the MATLAB and Java class path shall be avoided.
PriorityStrongly recommended
Severity level2
DescriptionRuntime changes to the MATLAB and Java class path shall be avoided.
RationaleIn a deployed application, the MATLAB and Java paths are fixed and cannot change. See Mathworks documentation.

avoid

Avoid calling the following functions, as they manipulate either the MATLAB path or the Java Class path:

addpath(_)
rmpath(_)
path(_)
javaaddpath(_) 
javarmpath(_)
javaclasspath(_)

instead use

As a deployed application can not adapt the MATLAB or Java class path, the definition of these paths should be separated from the code that will be deployed. For example, have a separate script or function, or use MATLAB Projects, to manages the path during development.