Program a Variant Subsystem
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Ryan G
on 5 Oct 2012
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 Comments
See Also
Categories
Find more on Component-Based Modeling in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!