모델 내 사용된 모든 block 이름 data type을 한번에 볼수 있는 방법?

조회 수: 6 (최근 30일)
MathWorks Support Team
MathWorks Support Team 2020년 9월 14일
편집: MathWorks Support Team 2020년 9월 17일
Simulink 모델에서, 사용된 모든 block 이름 data type을 한번에 볼수 있는 방법이 있을까요?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2020년 9월 17일
편집: MathWorks Support Team 2020년 9월 17일
말씀하신 사항은 간단히 Model Explorer 창에서 확인이 가능합니다.
또한 find_system 명령어 사용으로도 확인이 가능합니다.
예시)
open_system('vdp')
% Compile the vdp model
vdp([],[],[],'compile');
% Find all blocks in model
allBlocks = find_system('vdp','Type','Block')
% Loop through all blocks
for i = 1:numel(allBlocks)
lh = get_param(allBlocks{i},'PortHandles');
outports = lh.Outport;
% Loop through all output ports
for j = 1:numel(outports)
dataType = get(outports(j),'CompiledPortDataType');
% Display the data type
disp([allBlocks{i} ' output port ' num2str(j) ': ' dataType]);
end
end
% Terminate
vdp([],[],[],'term')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 이벤트 함수에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!