![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1758629/image.png)
Where to find the generated simscape code
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi does anyone know where to find the generated simscape code? I simply built a dummy model down below and then used simulink coder to generate the c code. I already know that the Simulink Coder software generates code from the Simscape blocks separately from the Simulink blocks in my model, but where does this file store? and which file contains the c code of the simcape blocks?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/503903/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/503908/image.png)
0 commentaires
Réponses (1)
Shubham
le 23 Août 2024 à 11:05
Hi Sam,
When you use Simulink Coder to generate C code from a Simulink model that includes Simscape blocks, the code for Simscape blocks is generated separately from the code for Simulink blocks. After generating the code, all the generated files, including those from Simulink and Simscape blocks, are stored in the same directory. This directory is typically named after your model, followed by an "_grt_rtw" or similar suffix, depending on your system target file (e.g., "model_grt_rtw").
Generated code for Simscape blocks is present in the "Other files" section in the "Code Generation Report". Refer to the screenshot below for reference.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1758629/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1758629/image.png)
Please note that in your model if you have voltage or resistance is set to 0, you will not see the generated Simscape files since respective blocks are eliminated by code generation optimization. Code is not generated for eliminated blocks.
For more information on "How Simscape Code Generation Differs from Simulink", refer to the following documentation link:
Hope this helps.
0 commentaires
Voir également
Catégories
En savoir plus sur Deployment, Integration, and Supported Hardware dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!