Cannot run Simscape code

1 vue (au cours des 30 derniers jours)
Najla
Najla le 21 Août 2024
Réponse apportée : arushi le 21 Août 2024
I am doing root mean squared analysis in MATLAB using simulink. There is no panel above the blocks to run my code, which according to the video I'm referencing, should be a panel named "C code." How do I run the code?

Réponses (2)

Divyajyoti Nayak
Divyajyoti Nayak le 21 Août 2024
Modifié(e) : Divyajyoti Nayak le 21 Août 2024
Hi @Najla,
The 'C code' tab appears when you want to generate code, either by using 'ctrl + b' shortcut or when you use any of the code generation apps. You can find the code generation apps in the drop down box of the 'Apps' tab
Hope this helps!

arushi
arushi le 21 Août 2024
Hi Najla,
In MATLAB Simulink, if you're looking to generate and run C code from your Simulink model, you're likely referring to the Simulink Coder. This tool allows you to generate C code from a Simulink model, which can then be compiled and executed. If you're not seeing the "C Code" tab or panel, here are some steps you can follow to ensure you have the necessary setup and can run your code:
  • In the MATLAB toolstrip, click on the Apps tab. This tab lists various applications available in your MATLAB installation.
  • In the Apps tab, there is a search bar where you can type "Simulink Coder".
  • If Simulink Coder is installed, it should appear in the search results.
  • Click on the Simulink Coder icon to launch it. This should open the Simulink environment with the necessary tools and panels for code generation.
  • Open your Simulink model.
  • Once Simulink Coder is active, you should see additional options related to code generation.
  • You can generate code by navigating to the C Code tab.
Hope this helps.

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by