Legacy Code Tool example

as the picture shows:

Legacy <wbr>Code <wbr>Tool范例
If the called function has neither input parameters nor return value, it is also possible~~
 
lct_spec = legacy_code('initialize');
lct_spec.Options.language = 'C';
lct_spec.SFunctionName = 'sfun_LegacyCode';
lct_spec.SourceFiles = {'LegacyCode.c'};
lct_spec.HeaderFiles = {'LegacyCode.h'};
lct_spec.OutputFcnSpec = 'void myLegacyCodeTestFcn(void)';
legacy_code('sfcn_cmex_generate', lct_spec);
%legacy_code('compile', lct_spec);
legacy_code('generate_for_sim',lct_spec);
%legacy_code('rtwmakecfg_generate', lct_spec);
legacy_code('slblock_generate', lct_spec, 'myModel');
%legacy_code('slblock_generate', lct_spec);
 
The calling process at this time is more flexible, you can choose any one of the following diagrams:

Legacy <wbr>Code <wbr>Tool范例

 

Guess you like

Origin blog.csdn.net/lm393485/article/details/88894300