Вы находитесь на странице: 1из 1

You have a function (in this example: myshift) declared in myfun.h and defined i n myfun.

c 1] Follow procedure for Legacy code in mycreate.m You will obtain myfun_sfun.c and myfun_sfun.tlc 2] Copy myfun_sfun.c --> shift.c myfun_sfun.tlc --> shift.tlc 3] Open shift.c and find #define S_FUNCTION_NAME than change myfun_sfun with shift You can see this operation comparing shift.c and myfun_sfun.c in this folder 4] Open the shift.tlc and do these operations: - File: myfun_sfun.c --> shift.c - %implements myfun_sfun "C" --> %implements shift "C" - In BlockTypeSetup function, delete all references to external files - In Output function change call to myshift with the real myshift - In BlockOutputSignal you can comment the switch related to retType You can see these operations comparing shift.tlc and myfun_sfun.tlc in this folder 5] In MDL file create an S-Function, passing it shift.c as file name (see ptf.m dl)

Вам также может понравиться