what does the following syntax do?

조회 수: 2 (최근 30일)
Yash Nichat
Yash Nichat 2018년 7월 18일
답변: Monika Jaskolka 2020년 3월 28일
if ~isempty(Root_InPorts)
Root_InPorts = get_param(Root_InPorts,'Name');
end
Num_Of_Root_InPorts = numel(Root_InPorts);
Root_OutPorts = find_system(Search_Path,'SearchDepth',1,'BlockType','Outport');
if ~isempty(Root_OutPorts)
Root_OutPorts = get_param(Root_OutPorts,'Name');
End
Num_Of_Root_OutPorts = numel(Root_OutPorts);

채택된 답변

Monika Jaskolka
Monika Jaskolka 2020년 3월 28일
I think there is a line missing at the beginning:
Root_InPorts = find_system(Search_Path,'SearchDepth',1,'BlockType','Inport');
This code counts the number of Inport blocks and Outport blocks in the first level of a Simulink model, and provides this info in the variables Num_Of_Root_InPorts and Num_Of_Root_OutPorts respectively.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by