Making a S-Function from a Matlab script
古いコメントを表示
Hi,
I would like to make a S-Function from a block I got in an opened model.
I would like to automate this from a Matlab script. Is there a function to generate S-Function directly from Matlab editor ?
Thanks,
Eric
2 件のコメント
Kaustubha Govind
2012 年 7 月 13 日
Your question is a little confusing. Did you want to generate an S-function from a Simulink block/subsystem using commands, or did you want to generate an S-function from MATLAB code so you can call it in Simulink?
Eric
2012 年 7 月 13 日
回答 (1 件)
mdlName = 'YourModelName';
% Set the s-function target
set_param(mdlName,'SystemTargetFile','rtwsfcn.tlc');
% Build your subsystem
rtwbuild([mdlName '/' 'SubsystemName']);
カテゴリ
ヘルプ センター および File Exchange で Simulink Coder についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!