Checking "Signal must resolve to Simulink signal object" checkbox from code

4 ビュー (過去 30 日間)
Macko
Macko 2013 年 3 月 12 日
Hi,
I have created a sample model with the following code
pos_outport = [250 0 282 14];
pos_term = [50 15 75 30];
sys = 'mySys';
new_system(sys); % Create the model
open_system(sys); % Open the model
add_block('Simulink/Commonly Used Blocks/Out1', [sys '/Input1'],'Position', pos_outport);
add_block('Simulink/Commonly Used Blocks/Ground', [sys '/Ground1'],'Position', pos_term);
signal_line = add_line(sys, 'Ground1/1', 'Input1/1', 'autorouting', 'on');
set_param(signal_line, 'Name', 'OutputSignal1');
Now, my question would be which parameter to use in order to set the "Signal must resolve to Simulink signal object" checkbox on the OutputSignal1 signal? I guess it's a set_param call but which parameter name should be used in this case?
Many thanks in advance!

採用された回答

Kaustubha Govind
Kaustubha Govind 2013 年 3 月 13 日
srcPort = get_param(signal_line, 'SrcPortHandle');
set(srcPort,'MustResolveToSignalObject', 'on');

その他の回答 (1 件)

Macko
Macko 2013 年 3 月 13 日
Thank you! In the meantime I also received an answer from Support. They additionally told me about set(signal_line,'MustResolveToSignalObject',1) which is also working.

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by