How to connect to IF and IFACTION blocks programmatically
조회 수: 16 (최근 30일)
이전 댓글 표시
Hi, we are generating simulink via m script and using add_line but this doesn't seem to work for adding a line to or between if condition and action blocks as they don't have port numbers. Is there another command to do this? Thanks Colin
댓글 수: 0
채택된 답변
TAB
2012년 9월 18일
편집: TAB
2012년 9월 18일
% Get If block port handles
If_ph = get_param('If block path','porthandles');
% Get If action block port handles
Action_ph = get_param('If action block path','porthandles');
% Connect
add_line('Your model',If_ph.Outport(1),Action_ph.Ifaction);
% Note
% If_ph.Outport(1) for "If" port
% If_ph.Outport(2) for "Else" port
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!