In the above link, you will see a link for Code Generation, click on it and you will see several examples on how to generate code for ROS nodes within Simulink and MATLAB.
To get you started right now, please refer to this link:
Follow the instructions there and it will guide you through Code Generation for MATLAB. Note that the %#codegen directive just needs to be added to the top of your M files.
Also, please refer to this link to understand the limitations of code generation for Robotic Systems Toolbox functions:
Best Answer