Similar to how the command checkout RTW_Embedded_Coder
shows whether an e-coder license is available or not, how to verify if a Simulink Coder license is available or not?
The license names for MATLAB products are confusing as they have changed over time as products have evolved. Licence name "RTW_Embedded_Coder" is "Embedded Coder" and "Simulink Coder" has the license name "Real-Time_Workshop"
license('test','Real-Time_Workshop')
will return 1 if the license is available for check out or not.
See this link on the Mathworks support pages for a more complete list of license vs product names.
Or this answer tell you how to perform the name translation directly inside MATLAB
com.mathworks.product.util.ProductIdentifier.get('Simulink Coder').getFlexName
which returns Real-Time_Workshop