Borrar filtros
Borrar filtros

Is it possible to add a C wrapper to a SFunction?

2 visualizaciones (últimos 30 días)
archana b m
archana b m el 13 de Mzo. de 2013
Is it possible to add a C wrapper to a SFunction? How do i create the SimStrut of a particular model? Because all the functions in SFunction target have an input argument SimStruct *S. So if i have to invoke a function, then i need to pass the argument *S to it. Can you please tell me how to do it?

Respuesta aceptada

Kaustubha Govind
Kaustubha Govind el 19 de Mzo. de 2013
I don't believe it is currently possible to execute S-functions outside of the Simulink environment. the SimStruct data structure is allocated and managed by the Simulink Engine, and cannot be created by an external process. I would recommend that you refactor your S-function code such that the main algorithm is in a separate C-file (that is free of Simulink specific concepts like SimStruct) and call that from the S-function instead. This way, the C code can be shared by the S-function as well as other clients.

Más respuestas (0)

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by