How can I modify the MATLAB function block within a Library block (with active link) from the command line?
1 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2016-6-23
回答: MathWorks Support Team
2016-6-24
How can I modify the MATLAB function block within a Library block (with active link) from the command line?
采纳的回答
MathWorks Support Team
2016-6-23
You can obtain a handle to the linked MATLAB function block using the following commands:
root = sfroot;
model = getfullname(bdroot(BlockName));
SFMachine = root.find('-isa','Stateflow.Machine','-and','Name',model);
emlObj = SFMachine.find('-isa','Stateflow.LinkChart','-and','Path',BlockName);
where the variable 'BlockName' holds the name of the MATLAB function block you wish to modify.
Once you obtain the emlObj, you can make the desired changes to the MATLAB function block from the command line.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!