필터 지우기
필터 지우기

Automate signalbuilder attachment to subsystem

조회 수: 2 (최근 30일)
Kota Suzuki
Kota Suzuki 2017년 5월 12일
편집: Ashwini Venkatappa 2017년 5월 15일
Is there a way to automatically attach a signalbuilder to a subsystem through the command window? Example: 10 signals from signalbuilder connected to subsystem which has 10 inputs. I am planning on automatically creating a signalbuilder, and would like to attach it to an existing subsystem as input without actually touching simulink and just working through the command window.

답변 (1개)

Ashwini Venkatappa
Ashwini Venkatappa 2017년 5월 15일
편집: Ashwini Venkatappa 2017년 5월 15일
create a blank system 'untitled'
%To add a subsystem 'contoller' >> add_block('simulink/Ports & Subsystems/Subsystem','untitled/controller'); %To add a signal builder >> add_block('simulink/Sources/Signal Builder','untitled/sig'); %To connect the signal builder to the subsystem >> SubsysPortHandles = get_param('untitled/controller','PortHandles'); >> SigPortHandles = get_param('untitled/sig','PortHandles'); >> add_line('untitled',SigPortHandles.Outport(1),SubsysPortHandles.Inport(1))
For more information on ADD_BLOCK and ADD_LINE please refer the MATLAB documentation:
web([docroot,'/toolbox/simulink/slref/add_block.html'])
and
web([docroot,'/toolbox/simulink/slref/add_line.html'])
In order to manipulate the Signal Builder use "signalbuilder" command . For more information refer to the link below

카테고리

Help CenterFile Exchange에서 プログラムによるモデル編集에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!