Reputation: 4188
I know that it is possible to create S-function from C code that I provide. But is it possible to create one S-function from C Code, which is generated from a Simulink Model for dSPACE ECUs, with low effort. The reason is, I am trying to test the dspace code with matlab/simulink. Furthermore I'm aksing because the generated code from this simulink model consists multiple .c and .h files and I don't know how to integrate these files in one s-function block.
Upvotes: 0
Views: 653
Reputation: 371
There are several methods of doing this. I suggest using the Legacy Code Tool as its structure helps to guide you through the process. You could also explore calling the function(s) from Stateflow or a Matlab Function block depending on the application.
With respect to multiple c/h files. I assume they will all need to be visible to Matlab through pointing to the source paths, but you should be able to identify the 'entry' function that you're interested in and utilize that in your model.
Upvotes: 1