This might occurs because there are paths being added using ADDPATH in the startup.m or matlabrc.m file.
When a standalone application is compiled using MATLAB Compiler, the commands in the these files are also executed and these paths are not recognizable in the compiled standalone application. Hence, the error occurs.
To resolve this, use the "isdeployed" flag to ensure the commands in these files are not executed by deployed applications.
For example, if(isdeployed) % some code that does not have else addpath(...) end
An alternative is to just rename the startup.m and matlabrc.m file before building the standalone application. This workaround is explained below. 1. Find the location of these files with the commands below.
>> which -all startup.m >> which -all matlabrc.m
Some file might not be located in your directory and might 'not found' message.
2. Rename the files for which location is given. For eg., startup1.m , matlabrc1.m
3. Compile your application
4. Execute your standalone application and see if that solves the issue
5. Change the names of the files you renamed to 'startup.m' and 'matlabrc.m'.
Best Answer