MATLAB: C code to S function tutorials

c codelegacy toolboxMATLABs-functionsimulinkSimulink Real-Timetutorials

Hi does anyone have any good tutorial examples that i can use to get to grips with using the legacy code toolbox ?
I have some C code and I want to learn effective ways to to turn it into S code to put in my simulink model. This model will eventually be working on a real time machine.
I have been told that the legacy code tool box is my best candidate. Does anyone have any informative tutorials that might help ?

Best Answer

There are several examples in Simulink documentation for the legacy code tool. Look under "Custom Blocks with S-functions, System Objects and Legacy Code Tool" in:
Do consider the S-Functions mentioned in Bruno's answer as well and choose the solution which seems more suitable for you.