Limitations for MATLAB Compiler and MATLAB Compiler SDK
R2026bMATLAB® Compiler™ supports core MATLAB language features, including functions, classes, and objects. It can package many MATLAB and toolbox capabilities for deployment.
Deployed applications and components do not support every MATLAB and toolbox feature. Use these references to confirm whether specific functionality is deployable:
| Category | Description |
|---|---|
| Support for MATLAB, Simulink, and Toolboxes | Use this page as the primary reference for product and feature support in deployed mode. |
| Functions Not Supported for Compilation by MATLAB Compiler and MATLAB Compiler SDK | Use this page to identify commonly encountered non-deployable functions and categories. |
Compiled applications run only on operating systems that support MATLAB. Components that MATLAB Compiler generates cannot be used inside MATLAB. MATLAB Runtime is approximately the same size as MATLAB, so deployed applications require adequate storage and memory. For current requirements, see MATLAB System Requirements.
For multiplatform considerations, see Ensure Multiplatform Portability for Compiled Applications.
Before You Start Checklist
Confirm that your required toolbox features are supported for deployment, using Support for MATLAB, Simulink, and Toolboxes.
Avoid using callback strings for critical application behavior.
Decide how you will package required data files and how you will locate them at run time.
Decide whether your application needs Java®. As of R2026b, Java is no longer installed with MATLAB or MATLAB Runtime. If your application requires Java, install a compatible OpenJDK® distribution on the target machine. For details, see Use Java Runtime Environment (JRE) with MATLAB Runtime. If your application uses graphics, do not use
-nojvm.
Design-Time Constraints
To write code that can be successfully packaged, review these limitations and their workarounds before you design your application.
| Area | Limitation | Workaround |
|---|---|---|
| Shipped GUIs and apps (Not Supported) | Many prebuilt interactive interfaces included in MATLAB toolboxes are not deployable. | Use programmatic workflows and confirm support early. |
| Desktop features (Not Supported) | Interactive tools and environment panels are unavailable in deployed mode. | Avoid reliance on desktop-only features. |
| Non-programmatic workflows (Not Supported) | Some functionality cannot be invoked reliably in deployed mode if it cannot be called directly from the command line. | Replace with programmatic equivalents. |
| Workspace control (Restricted) | Deployed applications cannot dynamically manipulate local or base workspaces at
run time using eval, evalin, or
assignin. | Avoid using string evaluations to create or modify variables dynamically. |
| Parallel pools (Restricted to max 1 pool) | Deployed applications that use a shared MATLAB Runtime instance or singleton runtime cannot use more than one parallel pool.
Parallel Computing Toolbox™ functionality is not supported in MATLAB
Compiler SDK™ C++ shared libraries using the MATLAB Data API interface in
To use thread-based parallel pools
( | Refactor your code to create multiple MATLAB Runtime processes. |
| Licensing restrictions (Restricted) | Some capabilities are restricted by design or underlying licensing constraints in deployed mode. | Verify support and licensing requirements before running a build. |
Build and Packaging Constraints
Accepted File Types by Deployment Target
Valid and invalid file types depend on the deployment target. Each entry-point file must have only one entry point.
| Target | Valid entry point file types | Invalid entry point file types |
|---|---|---|
| Standalone applications | MATLAB MEX files, MATLAB scripts, MATLAB functions, MATLAB class files, protected function files with the
.p extension | Java functions, COM components, .NET components, data files |
| C shared libraries, C++ shared libraries, .NET assemblies, Java packages, Python® packages, COM components | MATLAB MEX files, MATLAB functions, MATLAB class files | MATLAB scripts, protected function files with the .p
extension, Java functions, COM components, .NET components, data files |
| Web apps | MATLAB apps in binary format (.mlapp), MATLAB apps in plain text format (.m) | MATLAB MEX files, MATLAB scripts, MATLAB class files, protected function files with the
.p extension, Java functions, COM components, .NET components, data files |
| MATLAB Production Server™ archives | MATLAB functions, protected function files with the .p
extension | MATLAB scripts, MATLAB MEX files, MATLAB class files, MATLAB live scripts (.mlx), Java functions, COM components, .NET components, data files. MATLAB class files can be dependent files. |
| Microservices | MATLAB functions, protected function files with the .p
extension | MATLAB scripts, MATLAB MEX files, MATLAB class files, MATLAB live scripts (.mlx), Java functions, COM components, .NET components, data files. MATLAB class files can be dependent files. |
When you use a P-code file (
.p) as an entry point, dependency analysis cannot discover the functions and classes the file calls. You must explicitly include all required dependencies, using theAdditionalFilesoption, the-aflag withmcc, or the Custom Requirements section of a compiler app.For MATLAB Production Server archives, you can include MATLAB class files as dependent files.
You can add other types of files to the packaged archive, including data files. For details, see Include Additional Files in Packaged Applications.
Dependency Analysis Limitations
MATLAB Compiler packages the MATLAB files that you specify and any additional MATLAB files that those files call. MATLAB Compiler uses dependency analysis to determine required functions and classes.
Dependency analysis can miss functions when a function name appears only at run time or is hidden from static analysis. This table describes common patterns that cause missed dependencies.
Common Patterns and Fixes
| Pattern | Problem | Recommended Fix |
|---|---|---|
| Function name appears only in a callback specified as a text string | Dependency analysis does not parse callback strings for function names | Use function handles instead of callback strings, or use the
%#function pragma to explicitly include the
function |
Function name appears only in a character array passed to
feval or an ODE solver | The function name is available only at run time | Add %#function or include the file explicitly using
AdditionalFiles, -a, or the
Custom Requirements section of a compiler app |
| Dependent functions stored in MAT files that are loaded at run time | Static dependency analysis cannot discover dependencies in MAT files | Include required files explicitly using
AdditionalFiles, -a, or the
Custom Requirements section of a compiler app |
| P-code file where the original MATLAB source is unavailable | Dependency analysis cannot discover dependencies from P-code alone | Include all required dependencies explicitly using
AdditionalFiles, -a, or the
Custom Requirements section of a compiler app |
Find Missing Functions in MATLAB Files. To identify candidates for explicit inclusion, search your source code for these patterns:
Callback properties specified as text strings, including properties ending in
FcnText arguments passed to
feval,fminbnd,fminsearch,funm,fzero, and ODE solvers
Cannot Create Output File
If you see an error such as Can't create the output file
, check for these common causes:filename
No write permission to the output folder
Insufficient free disk space in the output folder
A previously launched executable still running and preventing overwrite
Packaged Help Text Is Not Available
For performance reasons, MATLAB file comments are removed before MATLAB Runtime encryption. If you package a MATLAB file that contains help text in comments, the output of help
can be unintelligible in deployed
mode.filename
Runtime Constraints
Java and Graphics
As of R2026b, Java is no longer installed with MATLAB or MATLAB Runtime. If your deployed application requires Java (for example, for Java database access using JDBC or Java-based third-party libraries), you must install a compatible OpenJDK distribution on the target machine. For details, see Use Java Runtime Environment (JRE) with MATLAB Runtime.
If your program uses graphics and you compile it with -nojvm, the
deployed application can throw an error at run time. If your application requires graphics, do not
use -nojvm.
On Linux®, if Java is not installed or not on the library path, you might see warnings related
to libjvm.so. To resolve these warnings, install OpenJDK and set the MATLAB Runtime library path appropriately. For details, see Set MATLAB Runtime Library Paths for Deployment.
File Location and Discovery Differences
In deployed applications, using which does not search the current
working folder. Using open can also lead to unexpected results if your application relies on current folder search.
Use one or more of these alternatives:
Use
loador a file-type-specific reader that checks the current folder explicitly.Use
ctfrootto locate files that are packaged with the deployable archive.Include the file as an additional packaged file and then locate it using a documented deployment file access workflow.
For details, see Include Additional Files in Packaged Applications.
Restrictions on Calling printdlg with Multiple Arguments in
Packaged Mode
In deployed mode, printdlg accepts only one input argument. Calls
that provide multiple arguments can fail in deployed applications, even if they work in
MATLAB.
Language Binding Constraints
C++ mwArray Resizing
In C++, mwArray does not support dynamic resizing using
SetData. Allocate the required size before you call
SetData, or create a new mwArray with the
desired size.
Quick Troubleshooting Guide
Use this table to diagnose common deployment run-time errors:
| Error | Likely Cause | Relevant Section |
|---|---|---|
| UI element does not respond | Missing packaged dependency due to indirect reference | Dependency Analysis Limitations |
| Unknown function error in deployed mode | Indirect call via callback string or feval | Dependency Analysis Limitations |
| Graphics fails at run time | -nojvm used with graphics | Java and Graphics |
Java-related error or libjvm.so
warning at run time | OpenJDK not installed on target machine | Java and Graphics |
| File cannot be found | Current folder search differs in deployed mode | File Location and Discovery Differences |
printdlg fails in deployed mode | Multiple input arguments not supported | Restrictions on Calling printdlg with Multiple Arguments in Packaged Mode |
| Cannot create output file | Permissions, disk space, executable still running | Cannot Create Output File |
See Also
Topics
- Functions Not Supported for Compilation by MATLAB Compiler and MATLAB Compiler SDK
- Include Additional Files in Packaged Applications
- Set MATLAB Runtime Library Paths for Deployment