How to use add_block function to add a new block into the subsystem?

5 ビュー (過去 30 日間)
wang
wang 2014 年 9 月 19 日
コメント済み: wang 2014 年 9 月 19 日
i just create a new Library which called Steuergeraet in Simulink.In this Libray there is two block, SG1(Subsytem) and DC_DC.
Here is the code, with which I want to add the Block DC_DC into SG1.
add_block('Steuergeraet/SG1',[gcs,'/SG1'],...
'Position', [140 50 270 125]);
set_param(gcb, 'LinkStatus', 'inactive');
add_block('Steuergeraet/DC_DC','/SG1/DC_DC','MakeNameUnique','on');
But there is error in third line.
A new block named '/SG1/DC_DC' cannot be added
Really aprreciate, someone can give some suggestion.!
Regards.

回答 (1 件)

A Jenkins
A Jenkins 2014 年 9 月 19 日
Perhaps you need to unlock the libaray?
set_param('library_name', 'Lock', 'off');
I can't test it right now, but library_name might be 'Steuergeraet', or perhaps 'Steuergeraet/DC_DC'?
  1 件のコメント
wang
wang 2014 年 9 月 19 日
set_param(gcb, 'LinkStatus', 'inactive');
this command was used to disable the libray link.otherwise can not put or change the block in the subsystem.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSubsystems についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by