MATLAB: How to deploy MATLAB functions that are in custom packages using MATLAB Compiler 4.13 (R2010a)

compiledeployMATLAB Compilermccnamespacepackagepackages

If I have MATLAB functions in custom packages i.e. MATLAB functions existing in directory whose name starts with '+'. I am trying to understand on how I can deploy the MATLAB functions in packages.

Best Answer

Let us assume there are two MATLAB functions ‘myFunction1.m’ and ‘myFunction2.m’ in the path: T:\+test
In order to compile the above functions, there is a need of wrapper like below in path: T:\
function main
disp('I am from main');
test.myFunction1;
test.myFunction2;
end
Then this wrapper file can be used to create an executable either using DEPLOYTOOL or using MCC command. Here is an example on how the file is compiled using MCC command, note that you do not need to include MATLAB functions in packages with –a option for MCC command.
mcc -m main.m