Details

Controls when MEX function global data is synchronized with the MATLAB global workspace. The default value (At MEX-function entry, exit and extrinsic calls) synchronizes global data at MEX function entry and exit and for extrinsic calls for maximum consistency between MATLAB and the generated MEX function. If the extrinsic calls do not change global data, use this option in conjunction with the coder.extrinsic -sync:off option to turn off synchronization for these calls to maximize performance.

At MEX-function entry and exit synchronizes global data at MEX function entry and exit only. If your code contains extrinsic calls, but only a few change global data, use this option in conjunction with the coder.extrinsic -sync:on option to turn on synchronization for these calls to maximize performance.

Disabled disables synchronization. Verify that your MEX function does not interact with MATLAB before disabling synchronization. Otherwise, inconsistencies between MATLAB and the MEX function might occur.


Tradeoffs to Consider

Disabling synchronization results in less generated code and faster MEX function execution.