I want to create customized S function blocks and also generate C code for them using real time workshop. I could not quite find the correct documents for this task. Could someone please help me by pointing to correct and easy documentation?
Asked
Active
Viewed 459 times
0
-
2They'll have to be C S-functions. Level 1 M S-functions are not supported by code generation. Level 2 M S-functions are supported, but you will need to write the TLC that goes with your S-function. See for example http://uk.mathworks.com/matlabcentral/answers/40240-tlc-file-for-level-2-s-function. – am304 Jan 20 '15 at 15:56
1 Answers
2
Assuming you have Simulink Coder (and its documentation) installed, then for a general discussion of how c-mex S-Functions are handled open the doc by doing
docsearch('Insert S-Function Code')
then click on the link that says 'Insert S-Function Code' -- which may not be the first link.
To see info on how to inline an S-Function using a .tlc file look at the following,
docsearch('Inlining C MEX S-Functions')

Phil Goddard
- 10,571
- 1
- 16
- 28
-
Thanks both for your help. I am able do this now. but facing another problem. Do have any idea about concatination of type real_T with string in tlc scripts ? – Be_bro Jan 26 '15 at 14:18