MATLAB: Errors thrown in custom code when moving to new release that were not seen prior to MATLAB R2018b

simulink coder

I have a model that fails to build in MATAB R2018b and it throws a errors related to the custom code that I include. However, this model built successfully in MATLAB R2018a and I have not changes the model or the custom code. What has changed?

Best Answer

Starting in MATLAB R2018b changes were made as to how we parse custom code used in a model. This may lead to new errors being thrown on models being upgraded. Try disabling the "Import custom code" option for the model in Configuration Parameters > Simulation Target.
More information on this option is here:
Specifically see this line, under the "off" setting:
"Split custom code dependencies between Simulation Target and other means of specifying custom code dependencies (coder.cinclude, coder.updateBuildInfo, and coder.ExternalDependency) in Stateflow charts that use MATLABĀ® as the action language, MATLAB Function block, or the MATLAB System block."