MATLAB: Get port name along with number

MATLABmatlab coder

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.

Best Answer

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')]
Related Question