How to replace a Constant block with a From Workspace block programatically?

How to replace a Constant block with a From Workspace block programatically? I have tried with replace_block but shows an error InvalidBlockHandle . If to replace the same constant block with inport its working fine .

 采纳的回答

Try this... e.g. Model is open, block is named as 'Constant'...
replace_block(bdroot,'Name','Constant', 'built-in/FromWorkspace')

1 个评论

Thank you very much . I was trying with replace_block(bdroot,'Name','Constant', 'built-in/From Workspace');

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Interactive Model Editing 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by