MATLAB: Are the Simulink Coder app and/or Embedded Coder app missing from Simulink toolstrip? And why are “Code Generation” options are not available in model Configuration Parameters

codegenEmbedded Coderlicenseoptionsrtwsimulink coder

When trying to generate C/C++ code from a Simulink model, I encounter one of the following issues: 
1. In the Configuration Parameters dialog box, the Code Generation tab is missing. 
2. Using R2019b or newer, in Simulink Toolstrip, I am unable to find the Simulink Coder app or Embedded Coder app.
3. Using R2019a or older, the Simulink menu Code > C/C++  Code > Code Generation Options... is unavailable or produces an error: 
Page "Code Generation" is not a valid page.

Best Answer

The above options are only available if you have "Simulink Coder" (and optionally "Embedded Coder") installed and licensed for. Please try out the following troubleshooting steps:
1. Try restarting: 
Restarting MATLAB and/or your PC may resolve the issue, especially if a MathWorks related product was recently installed or updated.  
2. Check if the Code Generation option is present for a shipped model:
>> vdp
Check for the Code Generation option in Model Configuration Parameters (CTRL+E) .
If the code generation options are available for the shipped model:
     a. Check if the model without the options has any issues in the Upgrade Advisor.
     b. Try to re-create the model in a fresh file by copying and pasting all blocks.
If the code generation options are available for the shipped model and the issue persists after the above checks, contact MathWorks Technical Support
If the code generation options are not available for the shipped model, please see below. 
3. Check Licensing: 
>> [status,errmsg] = license('checkout','Real-Time_Workshop') % for Simulink Coder
>> [status1,errmsg1] = license('checkout','RTW_Embedded_Coder') % for Embedded Coder (optional)
Check that status = 1 and errmsg = 0×0 empty char array.
>> license('inuse')
Check that the license for Simulink Coder is listed,  i.e. "real-time_workshop", and "rtw_embedded_coder" for Embedded Coder if applicable.
If a license checkout fails, or is not listed as in use after checkout, contact your MATLAB License Administrator, or MathWorks Installation Technical Support
4. Check Installation: 
>> ver -support
Check that "Simulink Coder" is listed (additionally "Embedded Coder" if applicable).
If the product has a license, but is missing from the above, then add "Simulink Coder" (and "Embedded Coder" if applicable) toolbox to your existing installation as shown in the following link:
If the product has a license and the above indicates it is installed and the issue persists, contact MathWorks Installation Technical Support
5. Check MATLAB path and cache: 
>> restoredefaultpath
>> rehash toolboxcache
>> sl_refresh_customizations
If the issue persists after the above steps, as well as the licensing and installation checks, contact MathWorks Technical Support
If the issue is resolved by the above steps, then you may optionally take an additional step to ensure it does not reappear: 
>> savepath
Note: The first command to restore the default path will remove any custom paths you may have created for the remainder of the current MATLAB session. (This may break the installation of  e.g. Optional Feature or Support Package Add-Ons.) The command above to save the path will make this change persist to new sessions. If you would like help backing up custom additions to your path please refer to the following link:
When contacting MathWorks Technical Support, please include the outcome of the above checks and your license information.