Code Generation from Simulink and S-function creation for C-code validation

Hi all, I have to generate C-Code of a Simulink/Stateflow block that is dynamic, meaning that its inputs and the generated outputs vary with time. Then I have to use this generated C-code in Simulink in order to validate it. Since the equivalent C-code Simulink block has to be dynamic, it should have the same inputs and outputs of the starting Simulink block. Someone could help me in performing this procedure?
Thanks in advance Stefano

3 Kommentare

Since the equivalent C-code Simulink block has to be dynamic, it should have the same inputs and outputs of the starting Simulink block. --> Confusing.
What do you mean by dynamic input & output ?
I mean that I have to put the equivalent C-code Simulink block inside a Simulink test bench where the input of the block vary with time.
So my goal is to start from a Simulink Block with N-inputs and M-outputs, translate it in C-code, and generate a Simulink block based on the C-code that has the same N-inputs and M-outputs of the starting Simulink block.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Kaustubha Govind
Kaustubha Govind am 7 Sep. 2012
You should simply need to create a subsystem from your block (even if it just the one block in the subsystem), right-click on the subsystem and Generate Code. Does this do what you need?

Kategorien

Mehr zu Simulink Coder finden Sie in Hilfe-Center und File Exchange

Produkte

Gefragt:

am 7 Sep. 2012

Community Treasure Hunt

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

Start Hunting!

Translated by