Program a Variant Subsystem
조회 수: 6 (최근 30일)
이전 댓글 표시
Hello everyone,
I want to know how can I configure a Variant Subsystem programmatically. I want to write a script that will generate such a module which just included a Variant Subsystem module and inside different Subsystems. The number of inports and outports depend on the parameters the user passes to the script.
I have read Simulink User Guide and Simulink Reference and didn't found anything under "Model and Block Parameters".
Whoever can lend me a hand please do ;) thanks in advance!
댓글 수: 0
답변 (1개)
Ryan G
2012년 10월 5일
Passing different number of input/output ports may not be supported, but you can workaround this issue by passing in the maximum number of signals ever expected and then terminating them in the susbsytems for which they are unused and grounding the inputs when they are not used as inputs programatically.
In the end it looks like you want build a model programitcally around the variant subsytem (adding/removing inports outports grounds and lines). Furthermore, to find out what you can and cannot do with the variant subsystem, you can click the subsystem and then go to the MATLAB command window and type:
get_param(gcb,'DialogParameters')
If you want even more options, try this:
blkHdl = get_param(gcb,'Handle');
get(blkHdl)
As previously stated, you may come across issues with limitation in the variant subsystem, but they can often be easily worked around.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Component-Based Modeling에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!