Get port name along with number

조회 수: 15 (최근 30일)
Hariom Singh
Hariom Singh 2018년 9월 19일
댓글: Hariom Singh 2018년 9월 19일
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.

채택된 답변

Christopher Wallace
Christopher Wallace 2018년 9월 19일
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')]

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

태그

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by