Use slbuild function for generating the executable files from simulink.
Refer follow the below link
For information on the same, look at Simulink Coder and Embedded Coder.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!