Is it possible to individually chose the language in which blocks are generated for a Simulink model

I have a simulink model with bunch of blocks I want to autocode this system but want to control the language of the source code. For example suppose I have 2 blocks A and B. I want to auto-code in such a way that Block A gets autocoded in C++ and block B gets auto coded in CUDA. Is this functionality supported.
The reason I am trying to do this is I have a model with with some custom blocks that need to be auto coded into CUDA code but this model also has a Nvidia TCP block that is also getting auto-coded into CUDA rather than C++ code. This behaviour is completely breaking my autocode. So if there is a fix to this problem that would be great.

Respuestas (1)

Hello Ishan,
I understand that you're looking to generate C++ code for some blocks and CUDA code for others within the same Simulink model. Unfortunately, Simulink doesn't support generating code in multiple languages for different blocks within a single model. Code generation in Simulink is generally language-agnostic at the block level, meaning that the entire model's code is generated in a single language, as specified by the model's configuration settings.
I hope this clarifies your question.

Categorías

Más información sobre Simulink en Centro de ayuda y File Exchange.

Productos

Versión

R2022a

Etiquetas

Preguntada:

el 27 de Jul. de 2022

Respondida:

el 23 de En. de 2025

Community Treasure Hunt

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

Start Hunting!

Translated by