what does the following syntax do?

2 visualizaciones (últimos 30 días)
Yash Nichat
Yash Nichat el 18 de Jul. de 2018
Respondida: Monika Jaskolka el 28 de Mzo. de 2020
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);

Respuesta aceptada

Monika Jaskolka
Monika Jaskolka el 28 de Mzo. de 2020
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.

Más respuestas (0)

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by