Get port name along with number

16 visualizaciones (últimos 30 días)
Hariom Singh
Hariom Singh el 19 de Sept. de 2018
Comentada: Hariom Singh el 19 de Sept. de 2018
0 down vote favorite I am using the below script which lets me find all output port name
simBlockH = get_param('LaneA_ICD_Fccroot', 'Handle'); handles = find_system(simBlockH, 'LookUnderMasks', 'on', 'FollowLinks', 'on', 'SearchDepth', 1, 'BlockType', 'Inport'); portNames = cellstr(get_param(handles, 'Name')) Output portNames =
144×1 cell array
{'g_ECU_1_1_1_Activation' }
{'g_ECU_1_1_2_Activation' }
{'g_ECU_1_1_3_Activation' }
{'g_SCU_1_1_Activation' }
{'g_SRV_1_1_Activation' }
What changes should I do to also get the port number.

Respuesta aceptada

Christopher Wallace
Christopher Wallace el 19 de Sept. de 2018
simBlockH = get_param('LaneA_ICD_Fccroot', 'Handle')
handles = find_system(simBlockH, 'LookUnderMasks', 'on', 'FollowLinks', 'on', 'SearchDepth', 1, 'BlockType', 'Inport');
portInfo = [get_param(handles, 'Name'), get_param(handles, 'Port')]

Más respuestas (0)

Categorías

Más información sobre Programmatic Model Editing en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by