Is it possible to add a C wrapper to a SFunction?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
1 comentario
Respuesta aceptada
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.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Configure C/C++ S-Function Features en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!