Troubleshoot System Objects in Simulink
Class Not Found
The MATLAB System block System object name parameter requires that you enter the full path to the System object™ class. In addition:
Check that the System object class is on your MATLAB® path.
Check capitalization to make sure it matches.
Check that the class name is a supported System object.
Do not include the file extension.
Error Invoking Object Method
The MATLAB System block supports only System objects written in the MATLAB language. If the software can identify an alternative block, it suggests that block in the error message, for example:
This message indicates that there is an existing dedicated and optimized block that you should use.
Performance
For fastest performance, set the block Simulate using
parameter to Code generation
. This setting allows the
MATLAB System block to run as fast as it can. The parameter is
set to this value by default.
This setting causes a slower startup time, as the software generates C code and creates a MEX-file from it. However, after code generation, later simulations have better performance. When the block uses generated code to simulate, performance is typically better than simulation without generated code.
In some cases, the implementation of your System object does not allow you to generate code, which requires you to set
Simulate using to Interpreted
execution
. For example, your System object can require MATLAB functions
beyond the subset supported for code generation. In this case, use propagation
methods to specify the block input and output port information. The MATLAB
System block then propagates this signal attribution information.