MATLAB: How to generate C++ Code for a Simulink Model that is Callable from C

ccodecoderembeddedEmbedded Codergeneration

How do I generate C++ Code for a Simulink Model that is Callable from C?

Best Answer

See the following steps:
1. Set the 'Language' to 'C++' under the Code Generation Settings
  
2. Set the 'Code interface packaging' to 'Nonreusable function' under the Interface Settings (under the Code Generation Dropdown)
     
3. Generate code for the model
See the following link for an example of this, and the rest of the page for more examples regarding customization of generated code: