Problems with Simulink Coder

Hi Everybody,
now i have a modell, which contains m file and matlab s-function. and i want to generate code for xPC target.
but it seems to be problem with the m file and matlab s-function.
so is that possible that with mcc or some other matlab tool make the model compatible with Coder or must i rewrite the m file and s-function in c.
need yr HELP!!!

1 comentario

TAB
TAB el 24 de Mayo de 2012
Are you using embedded Matlab block for m-code?

Respuestas (1)

Kaustubha Govind
Kaustubha Govind el 24 de Mayo de 2012

1 voto

MATLAB S-functions are supported for code-generation only if you can provide a TLC file for it, in order to specify the code to be generated for it.
For generic MATLAB code, you need to use the MATLAB Function Block, but note that a limited subset of the MATLAB language is supported for code generation.

2 comentarios

Ji
Ji el 24 de Mayo de 2012
for the s-function i have no tlc file for it. so that means i must rewrite it in c?
and for the m file, the MATLAN Function Block is for the modell. And now the modell is perfect for simulation. But now I want to generate code for xPC things. Is the generic MATLAB code compatible for it?
Kaustubha Govind
Kaustubha Govind el 24 de Mayo de 2012
Note that you need to use the Embedded MATLAB Function block (now renamed to just MATLAB Function block). I presume you are using the "old" MATLAB Function block which does not generate code, and has now been renamed as "Interpreted MATLAB Function" block. So you'll need to switch to Embedded MATLAB Function blocks, which do generate code, but will error out if you use any MATLAB code that's unsupported for code-generation.
For the S-function, yes, you could either re-implement your S-function in C, or just provide a TLC file for the existing MATLAB S-function. I think the latter might be quicker.

La pregunta está cerrada.

Preguntada:

Ji
el 24 de Mayo de 2012

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by